Reputation: 18046
I am running the latest version of VS2019 16.6.1 Yet the new project wizard for a windows class library still creates the old style project.
I want to use this method to research this problem
I found some help on converting framework projects here but not on creating new ones from scratch.
Upvotes: 4
Views: 6262
Reputation: 1500155
The simplest approach in my experience is to create a .NET Core/Standard project for whatever type of application you want (e.g. console or class library) and then edit the csproj file by hand. (You can edit the csproj file by just double clicking on the project in Visual Studio, if it's an SDK-style project.)
So as a concrete example, to create a .NET 4.7.2 class library, I'd choose "Class Library (.NET Standard)" from the list of project templates. That creates a project file like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
</Project>
Just edit the project to specify the target framework you actually want - so for .NET 4.7.2 you'd use:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
</Project>
(I tend to tidy up the XML at the same time removing the blank lines like that, but you don't have to of course :)
Upvotes: 5