Convert .Net Core to .Net Framework Convert .Net Core to .Net Framework asp.net asp.net

Convert .Net Core to .Net Framework


I have loaded core project to the VS 2017 RC Community and open *.csproj in text editor.

Just delete teg

<RuntimeFrameworkVersion>

and replace

<TargetFramework>netcoreapp1.1</TargetFramework>

to

<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>

And after all in project properties set to any another framework and reset back (VS reload and repair *.csproj file).


This worked for me in VS2017:

Start with .net core web project template.

Edit *.csproj so it looks like this:

<Project Sdk="Microsoft.NET.Sdk.Web">  <PropertyGroup>    <TargetFramework>net472</TargetFramework>  </PropertyGroup>  <ItemGroup>    <PackageReference Include="Microsoft.AspNetCore" Version="2.1.3" />    <PackageReference Include="Microsoft.AspNetCore.CookiePolicy" Version="2.1.2" />    <PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.1.1" />    <PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="2.1.1" />    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.2" />    <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.2" />    <PackageReference Include="Microsoft.AspNetCore.Mvc.RazorPages" Version="2.1.2" />    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.1" />  </ItemGroup></Project>

Save and close.

Try running project.

The PackReferences is just the NuGet files, and you can add them through the GUI if the versions are different from mine above.


There's lots of similar answers here, but I didn't see one that was quite what I ended up doing, so I'd like to leave this here just in case someone else is in the same shoes.

Just to be clear, my project was a console program. So, if you're trying to use this answer for something else, your mileage may vary.

In your .csproj file, inside of the <PropertyGroup></PropertyGroup> tag, modify <TargetFramework> to reflect the following:

<TargetFramework>net461</TargetFramework>

Now, in this example, I was using v4.6.1. I can only assume that you'll plug in your version behind the word "net", without the periods. Good luck!