Posts

Showing posts with the label Visual Studio

Enabling Powerlines in your Visual Studio Terminal

Image
I've been a fan of Windows Terminal since day one and have configured my terminal to include git information as well as the clock.  This is well document by many people including Scott Hanselman .  Over the last 2 weeks I've started playing with using Terminal within Visual Studio that is itself powered by Windows Terminal, you can tell I've used Visual Studio Code a lot recently and I like the integrated terminal, its convenient to have it open in the repo's directory, especially handy for testing build scripts. However, the default experience (for me at least) wasn't a great. I had setup my Visual Studio terminal as the following: Developer PowerShell, Developer Command Prompt (although I never use this and should probably kill it!) and then my 2 Ubuntu environments. Great, my terminal dropdown in VS lists everything nicely:  However.... It's imported my environment settings (which is great) but the default font is missing powerlines so everything is borke...

x86 .Net Core application fails to launch and debug via Visual Studio 2017

Today I had a random issue following changing one of my .Net Core projects. Usually I run these AnyCPU but this one needed to be X86 due to a third party library. I've done this before and had no issues but today VS seemed to launch the app and then immediately quit with an error exit code but no useful information! So far whenever I hit something like this I always try and run it via the console using dotnet run in the project directory. Fortunately this showed the issue straight away: It was not possible to find any compatible framework version The specified framework 'Microsoft.NETCore.App', version '2.1.5' was not found.   - Check application dependencies and target a framework version installed at:       C:\Program Files (x86)\dotnet\   - Installing .NET Core prerequisites might help resolve this problem:       http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409   - The .NET Core framework and SDK can be installed from: ...

project.json doesn't have a runtimes section, add '“runtimes”: { “win”: { } }' to project.json within a .Net Class Library

Recently I've started experiencing weird build errors when switch branches on a product. Error : Your project.json doesn't have a runtimes section. You should add '"runtimes": { "win": { } }' to your project.json and then re-run NuGet restore. It's a weird sounding error and the fact it mentions project.json makes it sound like a hangup from when .Net Core and Standard were using project.json files before they became .csproj files again. My first thought to resolve this is always try a clean and build, particularity when swapping branches things could get left hanging around but this doesn't work. I took a closer look at the projects affected and the cause is to do with one of the branches of our product. It's an early development branch of a new feature where the project has become .Net Standard 2.0 but also targets .Net 4.5, where as the support and main dev branch are still the full framework class libraries.  The cause is mos...

Experiences from using existing projects within VS2015

I've been using VS2015 since an early preview at home but now it's launched I've been trialling it with many of our solutions within work trying to iron out any associated pain before we upgrade every developer (that hasn't already ;)). One thing I've noticed across a few of our web projects that's caught a few people out is an issue with the new version of IIS Express, and actually if we ever got to deploying to IIS 10. For many of our web projects we have added additional mimeTypes via the web.config to allow IIS to serve up woff2 files, previously you would have done this via:  <system.webServer>     <staticContent>         <mimeMap fileExtension=".woff2"mimeType="application/font-woff2" />      </staticContent>  </system.webServer> However IIS 10, and therefore IIS Express 10, now handles this mimeType automatically. When you run your existing projects via VS2015 you will find all of your we...

My Favourite Visual Studio Features #myVSUK

Image
It's been really interesting to read some of people's submissions for the Visual Studio Features competition. Quite varied. I thought I'd add my top 5 into the mix, although I've probably missed the deadline :) 1 - Test Explorer Test Explorer, Docked Left in my Main Window I really love having Test Explorer baked in, especially when the XUnit runner is installed. Previously I used to use ReSharper's test manager but now I pretty much only use this. The addition of playlists in VS2013 has also helped. You can run tests automatically after build, search your tests and group in various ways. One of my most used features. 2 -  Navigate To or as I say Ctrl + T Finding those Test Types are now just one Key Combo away :) This is another feature I used to use Resharper extensively for, the ability to quickly find a type by name. Just hit Ctrl+, start typing, instant win :) 3 - Server Explorer with Azure Integration Managing and Viewing Azure Serv...

Windows Phone Development and Designer Exceptions

I've been building a few Windows Phone applications recently and have been learning lot's along the way and am hopefully releasing a couple of these in the near future. However on my current project I have been constantly hounded by the designer view of my xaml pages throwing exceptions. Tonight I decided to finally look into why these occur, I have managed to ignore them previously due to the weird nature of them. My exception scenario consists of a page that contains a pivot control and inside one of the pivot items there is a user control. The user control contains a simple list view which has some data bound to it Now I have always got past the exceptions as if you use the designer view for the user control it works fine, however as soon as I put it into a page or a pivot the designer starts kicking off. The actual exception is as follows: Could not load type 'System.Net.HttpUtility' from assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToke...

MVC 3 RC2 Install Error (0x80070643)

This evening I came to installing MVC3 RC2 on both my desktop and laptop. The laptop installed first time, however I found that on my desktop it refused to install. Citing the following error in its install log: Installation failed with error code: (0x80070643) After poking around in the log file I found that the VS10-KB2465236-x86.exe patch was where it was falling over. To try and get more information I found the temp directory with this file in and ran the installer manually. This also as expected errored, however this time when I looked in the log file I found a slightly different error: Install failed on product (Microsoft Visual Studio 2010 Express for Windows Phone - ENU) The next obvious place for me to go next was to uninstall the Windows Phone Developer Tools, I figured I can always reinstall them. Upon removing this I then tried to install MVC3 RC2 again. This time it still failed, with the same error I had previously but this time for Visual Studio 2010. As a final shot I w...

Visual Studio Welcome Screen

Today a colleague noticed that whilst he was debugging his web application random requests were being made to Microsoft, these requests were also returning a HTTP/1.1 301 Moved Permanently header, and apart from being annoying was causing him a few issues. From experience I soon realised that these requests were being made by the Visual Studio Welcome Screen. By default even if you don't use the welcome screen, Visual Studio keeps the Start Page News Channel RSS Feed up to date, the default in every 60 minutes. If you aren't using the welcome screen then its probably worth disabling the RSS feeds auto download content functionality, not only will this stop you seeing random requests, if you even notice them, but if you are working on a mobile and pay per KB save you some bandwidth. To disable the auto content update simply: goto Tools > Options, click the Show All Settings checkbox, then under the Environment leaf find Startup. Once here simply untick the "download cont...