Search code examples
c#visual-studio.net-core.net-standard.net-4.8

How to change .NET Framework to .NET Standard/Core in Visual Studio?


I have a solution in C# in Visual Studios. It was first created in .NET Framework. I want to convert the project to .NET Standard/Core. If I go into project --> properties I see the attached screen, where Target Framework is .NET Framework. How am I able to change that to .NET Standard/Core?

project --> properties: Target Framework Currently set to .NET Framework


Solution

  • As Roman Ryzhiy mentions in the comments, this is the way to go:

    https://learn.microsoft.com/en-us/dotnet/core/porting/

    This worked fine for me, I upgraded a .NET Framework 4.7.2 project. It was a small project, so I had few aftermath-problems. After the upgrade, the Target Framework in the Application tab will say ".NET 5.0".

    1. Install upgrade-assistant:

      dotnet tool install -g upgrade-assistant

    2. Go to your solution folder

    3. Run the assistant:

      upgrade-assistant upgrade your-project-name.csproj

    4. Follow the steps in the assistant, it's really straight-forward.

    Also, here are the steps more detailed:

    https://learn.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview#installation-steps