To complement the article on how to create a Blank Visual Studio 2017 solution, I'll post how to create a blank project.
Unfortunately, I've only been able to test this technique with C# projects, and F# is not guaranteed to work with this method yet. I have not tested this with Visual Basic.
Drop this text into a file with a
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFrameworks>net461</TargetFrameworks> </PropertyGroup> </Project>
That's all there is to it! You can then add this existing project to your solution in Visual Studio.
It is required to specify which framework you are targeting. This is included in the markup above already, but if you want to use something other than .NET Framework 4.5, see the below table for which value to use.
|.NET Core App 1.0||netcoreapp1.0|
|.NET Core App 1.1||netcoreapp1.1|
|.NET Core App 2.0||netcoreapp2.0|
|.NET Core App 2.1||netcoreapp2.1|
|.NET Framework 1.1||net11|
|.NET Framework 2.0||net20|
|.NET Framework 3.5||net35|
|.NET Framework 4.0||net40|
|.NET Framework 4.5||net45|
|.NET Framework 4.5.1||net451|
|.NET Framework 4.5.2||net452|
|.NET Framework 4.6||net46|
|.NET Framework 4.6.1||net461|
|.NET Framework 4.6.2||net462|
|.NET Framework 4.7||net47|
|.NET Framework 4.7.1||net471|
|.NET Framework 4.7.2||net472|
|.NET Standard 1.0||netstandard1.0|
|.NET Standard 1.1||netstandard1.1|
|.NET Standard 1.2||netstandard1.2|
|.NET Standard 1.3||netstandard1.3|
|.NET Standard 1.4||netstandard1.4|
|.NET Standard 1.5||netstandard1.5|
|.NET Standard 1.6||netstandard1.6|
|.NET Standard 2.0||netstandard2.0|
There's even more on the Microsoft website.
Multiple Target Frameworks
You can even specify multiple target frameworks by separating them with semicolons. Here's an example which targets both .NET Framework 4.6.1 and .NET Standard 2.0 per the recommendation of the guidance document (see the next section for more on that):
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFrameworks>net461;netstandard2.0</TargetFrameworks> </PropertyGroup> </Project>
Microsoft has released the Guidance for Library Authors. Definitely check this out.