“Value does not fall within the expected range” when trying to add a reference in a project

I did a ‘devenv /setup’ and that fixed it. Detail Exit Visual Studio Click Start Type cmd, right click Command Prompt and select Run as administrator Navigate to the appropriate Visual Studio folder VS2012: pushd %programfiles(x86)%\Microsoft Visual Studio 12.0\Common7\IDE VS2015: pushd %programfiles(x86)%\Microsoft Visual Studio 14.0\Common7\IDE VS2017: pushd %programfiles(x86)%\Microsoft Visual Studio\2017\<Edition>\Common7\IDE VS2019: pushd %programfiles(x86)%\Microsoft Visual Studio\2019\<Edition>\Common7\IDE … Read more

Force uninstall of Visual Studio

I was running in to the same issue, but have just managed a full uninstall by means of trusty old CMD: D:\vs_ultimate.exe /uninstall /force Where D: is the location of your installation media (mounted iso, etc). You could also pass /passive (no user input required – just progress displayed) or /quiet to the above command … Read more

How can I run NUnit tests in Visual Studio 2017?

Add the NUnit test adapter NuGet package to your test projects 2.* (https://www.nuget.org/packages/NUnitTestAdapter/) 3.* (https://www.nuget.org/packages/NUnit3TestAdapter/) Or install the Test Adapter Visual Studio extension. There is one for 2.* (https://marketplace.visualstudio.com/items?itemName=NUnitDevelopers.NUnitTestAdapter) 3.* (https://marketplace.visualstudio.com/items?itemName=NUnitDevelopers.NUnit3TestAdapter). I prefer the NuGet package, because it will be in sync with the NUnit version used by your project and will thus automatically match the … Read more

How to enable Nullable Reference Types feature of C# 8.0 for the whole project

In Visual Studio 16.2 (from preview 1) the property name is changed to Nullable, which is simpler and aligns with the command line argument. Add the following properties to your .csproj file. <PropertyGroup> <Nullable>enable</Nullable> <LangVersion>8.0</LangVersion> </PropertyGroup> If you’re targeting netcoreapp3.0 or later, you don’t need to specify a LangVersion to enable nullable reference types. For … Read more

How can I install the VS2017 version of msbuild on a build server without installing the IDE?

The Visual Studio Build tools are a different download than the IDE. They appear to be a pretty small subset, and they’re called Build Tools for Visual Studio 2019 (download). You can use the GUI to do the installation, or you can script the installation of msbuild: vs_buildtools.exe –add Microsoft.VisualStudio.Workload.MSBuildTools –quiet Microsoft.VisualStudio.Workload.MSBuildTools is a “wrapper” … Read more