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. Alternatively, … 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

Disabling highlighting of current line in the Visual Studio editor

Is there a simple way to disable this highlighting? Tools -> Options -> Text Editor, in the Display group, uncheck “Highlight current line” Which parameter in Fonts and Colors dialog controls the background color of the currently selected line in the editor? The colors are named “Highlight Current Line (Active)” and “Highlight Current Line (Inactive)”

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