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?
Asked
Active
Viewed 2.0k times
18
-
2Does this answer your question? [Convert .Net Framework 4.6.2 project to .Net core project](https://stackoverflow.com/questions/48057514/convert-net-framework-4-6-2-project-to-net-core-project) – MindSwipe Sep 03 '20 at 12:16
-
4This is probably an old-style csproj, yes? You kinda need to convert it to new-style ("SDK" style) csproj. For simple projects, this is trivial and is usually easiest done by simply creating a new-style csproj from scratch. – Marc Gravell Sep 03 '20 at 12:17
-
1https://learn.microsoft.com/en-us/dotnet/core/porting/ – Roman Ryzhiy Sep 03 '20 at 12:17
-
3If it's a relatively simple project, with little to no external dependencies, that has the VS 2017 and upward style .csproj format it's very easy, simply open your .csproj file in a text editor and change the `
` to `netcoreapp3.1` (or whatever .NET Core version you want), but make sure you have the right [SDK](https://dotnet.microsoft.com/download) installed. If it's an "old-school" style csproj format you'll first need to convert it (like [this](https://natemcmaster.com/blog/2017/03/09/vs2015-to-vs2017-upgrade/)) – MindSwipe Sep 03 '20 at 12:20
1 Answers
18
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 projekt. 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".
Install upgrade-assistant:
dotnet tool install -g upgrade-assistant
Go to your solution folder
Run the assistant:
upgrade-assistant upgrade your-project-name.csproj
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

Tornseglare
- 963
- 1
- 11
- 24