How can I change a .NET standard library to a .NET framework library?

Edward Minnix picture Edward Minnix · Jul 5, 2018 · Viewed 24.9k times · Source

I'm writing a class library for a simple parser in C#. When I first created it, I used .NET standard 2.0, but now I need to migrate it to .NET 4.6 both to conform to the other projects in my solution and in order to use NUnit.

I tried to follow the instructions in the Microsoft documentation, but when I try to select another framework in the properties, I can only find other .NET standard versions.

How can I migrate it? Will I need to manually edit the .csproj file?

Answer

Jammer picture Jammer · Jul 5, 2018

Open up the project file (.csproj) and change the TargetFramework to net462

  <PropertyGroup>
    <TargetFramework>net462</TargetFramework>
  </PropertyGroup>