How to change VS 2017 RC .csproj project's target framework (from core to classic)?
Edit csproj
file this way:
<TargetFramework>netcoreapp1.1</TargetFramework>
replace with:
<TargetFramework>net462</TargetFramework>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
and remove:
<PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" />
Then
dotnet restore
dotnet build
Optional:
dotnet run
Do not start dotnet run
from Package Manager Console. It starts but it become impossible to stop web app with ctrl c
(standard way).
If VS F5
doesn't work, (true for VS 2017 RC, core services generated with yoman templates), then change:
<OutputType>winexe</OutputType>
to
<OutputType>Exe</OutputType>
and restart VS, rebuild is not enough (to enable F5, again true for VS 2017 RC).
The safest option, if you have a few files, is to just add a new project with the correct framework. Then copy the files from the old project across. This will stop you having build and other issues.
.NET Core for example has its own class library, console and test types.