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

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

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


Here's what I've tried:

I went to the project properties and attempted to change the project framework, but I don't see the option I need in the dropdown:

Only .NETCoreApp displays in the target framework list.

If I click "Install other frameworks..." I'm taken to a page that says .NET Framework versions are included in Visual Studio 2017 -- which is exactly what I'm using to edit this project. This is where I got stuck.

Jon Skeet
people
quotationmark

If you're happy with it still using the new tooling, the easiest approach is probably just to edit the project file (csproj). Right-click on the project in Solution Explorer and you should have a context menu option of "Edit <yourproject>.csproj". Click on that, and just change

<TargetFramework>netcoreapp1.1</TargetFramework>

to

<TargetFramework>net46</TargetFramework>

... and I suspect you'll be good to go. (It may confuse VS for a little while as it restores appropriate packages etc.)

people

See more on this question at Stackoverflow