Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a sdk-style .net framework project in VS?

Is it possible to create an SDK-style .NET Framework project in Visual Studio (to be more specific I use the latest VS2019)? Or does it still require manual manipulations?

<Project Sdk="Microsoft.NET.Sdk">

I'm interested in creating a new project, not in migrating existing project from old .csproj file style to the new .csproj SDK-style. I've already edited .csproj files manually many times but it's super inconvenient.

like image 618
isxaker Avatar asked Jul 23 '20 13:07

isxaker


1 Answers

As others said, It is hard for us to create a sdk-style .net framework directly.

In other words, we have to do it manually.

You can refer to the following steps to make it.

First, we need to create a Class Library (.NET Standard) project.

Second, we need to modify the csproj file.

The initial file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

</Project>

You can edit it to:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
     <TargetFramework>net472</TargetFramework>
  </PropertyGroup>

</Project>

Finally, you can get a sdk-style .net framework project.

enter image description here

like image 177
Jack J Jun - MSFT Avatar answered Nov 14 '22 08:11

Jack J Jun - MSFT