none
Cant build new ASP.NET Core 2.0 project on VS 2017 Community RRS feed

  • Question

  • Recently I installed new Visual Studio 2017 and updated SDK and Runtime to latest version 2.0 then created new ASP.NET Core 2.0 project (before all this steps I uninstall VS 2015). After all I was not able to build project, always got the same error.

    Used tools:

    • Microsoft Visual Studio Community 2017 Version 15.3.5
    • ASP.NET and Web Tools 2017 15.0.30726.0
    • ASP.NET Core Razor Language Services 1.0
    • ASP.NET Template Engine 2017 15.0.30726.0
    • NuGet Package Manager 4.3.1
    • SQL Server Data Tools 15.1.61707.200

    And of course I have the latest SDK and Runtime installed

    Error:

    [22:57:51]
    [22:57:51]Errors in C:\path\to\project\Server\Server.csproj
    [22:57:51]    Package Microsoft.AspNetCore 2.0.0 is not compatible with net462 (.NETFramework,Version=v4.6.2). Package Microsoft.AspNetCore 2.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    [22:57:51]    Package Microsoft.AspNetCore.Mvc 2.0.0 is not compatible with net462 (.NETFramework,Version=v4.6.2). Package Microsoft.AspNetCore.Mvc 2.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    [22:57:51]    One or more packages are incompatible with .NETFramework,Version=v4.6.2.
    [22:57:51]    Package Microsoft.AspNetCore 2.0.0 is not compatible with net462 (.NETFramework,Version=v4.6.2) / win7-x86. Package Microsoft.AspNetCore 2.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    [22:57:51]    Package Microsoft.AspNetCore.Mvc 2.0.0 is not compatible with net462 (.NETFramework,Version=v4.6.2) / win7-x86. Package Microsoft.AspNetCore.Mvc 2.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    [22:57:51]    One or more packages are incompatible with .NETFramework,Version=v4.6.2 (win7-x86).
    [22:57:51]
    [22:57:51]Errors in C:\path\to\project\Server\Server.csproj
    [22:57:51]    Package Microsoft.Extensions.FileProviders.Physical 2.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.Extensions.FileProviders.Physical 2.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    [22:57:51]    Package Microsoft.VisualStudio.Web.CodeGeneration.Contracts 2.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.VisualStudio.Web.CodeGeneration.Contracts 2.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    [22:57:51]    One or more packages are incompatible with .NETCoreApp,Version=v2.0.
    [22:57:51]Process exited with code 1

    My csproj file

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

    <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    </PropertyGroup>

    <ItemGroup>
    <Folder Include="wwwroot\" />
    </ItemGroup>

    <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
    </ItemGroup>

    <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
    </ItemGroup>

    </Project>

    • Moved by 宝宝徐 Friday, September 29, 2017 7:30 AM
    Tuesday, September 26, 2017 3:54 PM

All replies

  • Hi Mr .Putin,

    Thank you for posting in MSDN forum.

    Please see Nuget restore fails for ASP.NET Core 2.0 project on build server, your Error log file is the same as one in this SO case, is that really your log file?

    >><TargetFramework>netcoreapp2.0</TargetFramework>

    Just according to this TargetFramework, there shouldn't be the compatible problem between the .Net core SDK and .NET framework 4.6.2. Please tell us the detailed information about this issue.

    Besides, this forum is about .Net Framework Setup and Servicing, from your description, this issue is much related to generating installer package for .Net Core project, I suggest you could post in https://forums.asp.net/1255.aspx/1?ASP+NET+Core  to get a better professional support.

    Thank you for your understanding and cooperation.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by 宝宝徐 Wednesday, September 27, 2017 7:58 AM
    Wednesday, September 27, 2017 7:58 AM
  • You might be using older nuget.exe to restore the packages.<o:p></o:p>

    If you download the latest nuget.exe from https://dist.nuget.org/win-x86-commandline/latest/nuget.exe and build it will solve the build issue.


    Wednesday, February 7, 2018 6:52 PM