2
votes

To configure asp.net-core project to use "framework" target (net462) it is required to delete package from csproj file:

<PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" />

Because it is for "Core" platform only.

May be because of this Visual Studio F5 button (Run) stopped working:

enter image description here

Is it possible to "reintegrate" asp.core targeted to net462 with Visual Studio?

ToolsVersion problem:

One question aside, what we should know about ToolsVersion from <Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0"> ? Till that moment I thought that we should worry about dotnet -v (aka tooling version). How to know which sdk's "ToolsVersion" is the last and which is actually installed on developer's computer?

Reproducing

I can't reproduce it with VS default ASP.CORE projects. It is happens only with Spa Services projects.

1
try removing the tools version, not sure if that is needed there and it might be targeting the wrong version...The Pax Bisonica
so instead of <Project Sdk="Microsoft.Sdk.Web" ToolsVersion="15.0"> you want just <Project Sdk="Microsoft.Sdk.Web">The Pax Bisonica
Microsoft.NETCore.App is only for .NET Core. You have to remove it for full .NET Framework applications, it is only a meta package for portalble .NET Core apps anywaysTseng
Meta package only means it is an empty package which references other common used packages for .NET Core, so you don't have to reference 20-30 packages manually. You can safely remove it when targeting .NET 4.x. You can see a list of packages it references here nuget.org/packages/Microsoft.NETCore.AppTseng
try changing it to a console app using <OutputType>Exe</OutputType>The Pax Bisonica

1 Answers

0
votes

As "The Pax Bisonica" suggested in comments:

Changing:

<OutputType>winexe</OutputType>

To:

<OutputType>Exe</OutputType>

helps, but only after Visual Studio restart (dotnet restore and dotnet build is not enough!!!). Together I have removed /bin and /obj folders so may be those steps also need to be included.

About:

<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0">

As I understand there ToolsVersion shares its value "15" from "Visual Studio 15" - prerelease/development name of Visual Studio 2017. I can't find an information about plans to change it with VS 2017 release. VS 2015's editions ToolsVersion = 14