How to convert a .NET Core project to a .NET Framework project?

I created the "Console Application (.NET Core)" project in Visual Studio. Now I need to add a dependency that only works on the .NET Framework 4.6+, and not on .NET Core.

Is there a way to convert my project into a full-fledged .NET Framework project?


Here is what I tried:

I went to the project properties and tried to change the structure of the project, but I do not see the desired option in the drop-down list:

Only .NETCoreApp is displayed in the target structure list.

If I click "Install other frameworks ...", I’m taken to a page where versions of the .NET Framework are included in Visual Studio 2017 - this is exactly what I use to edit this project. I'm stuck here.

+6
source share
1 answer

If you are happy that you are still using the new tool, the easiest way is probably to simply edit the project file (csproj). Right-click on the project in Solution Explorer and you should have the context menu option "Edit <yourproject> .proproj". Click on it and just change

<TargetFramework>netcoreapp1.1</TargetFramework>

to

<TargetFramework>net46</TargetFramework>

... and I suspect you will be fine. (It can be a bit confusing VS when it recovers the appropriate packages, etc.)

+12
source

Source: https://habr.com/ru/post/1016996/


All Articles