Search code examples
c#.net.net-standard.net-framework-version.net-4.6

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


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?


Solution

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

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