How to update version of Microsoft.NETCore.App SDK in VS 2017

23,727

Right click your project and edit your csproj file.

If you see a line like this:

<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>

Then update it to 1.1.2 or just remove this line. Then restore the packages (maybe using command line dotnet restore, I don't know whether VS will do this automatically).

This way you can update Microsoft.NETCore.App to 1.1.2 and this should fix your problem.

Share:
23,727
LP13
Author by

LP13

Updated on February 15, 2021

Comments

  • LP13
    LP13 about 3 years

    I have ASP.NET Core API project which was initially developed using VS 2015. I installed VS 2017 and let it convert the project.
    Then i goto Project Properties -> Application ->Target framework and change the target framework to .NETCoreApp 1.1.

    as soon as i do that i get 2 errors

    Error One or more projects are incompatible with .NETCoreApp,Version=v1.0.

    Error Project Api is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Project Api supports: netcoreapp1.1 (.NETCoreApp,Version=v1.1)

    when i checked Dependencies -> SDK -> Microsoft.NETCore.App -> Properties it shows version 1.0.4 and SDK Root to C:\Users\username\.nuget\packages\microsoft.netcore.app\1.0.4

    I have already installed Microsoft.NETCore.App SDK version 1.1.2 on my machine.

    When i goto Nuget Package Manager to update SDK version, it shows its Autoreferenced and update button is disabled.

    How do i update project's SDK's version to 1.1.2?

    Also why VS studio reference SDK from C:\Users\username\.nuget\packages\microsoft.netcore.app instead of from C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.1.2

    Update 1

    Actually 1.1.2 is not SDK version. As of 7/20/2017 the latest SDK version is 1.0.4 and Runtime version is 1.1.2 On my machine I have C:\Program Files\dotnet\sdk\1.0.4 SDK and C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.1.2 runtime installed.

    So as i mentioned erlier, when i open converted project in VS 2017, I see Dependencies -> SDK ->Microsoft.NETCore.App - Properties version is 1.0.4 and SDK Root is C:\Users\username\.nuget\packages\microsoft.netcore.app\1.0.4

    Now I added new project in the same solution, however new project's Dependencies -> SDK ->Microsoft.NETCore.App -> Properties version is 1.1.2 and SDK root C:\Users\username\.nuget\packages\microsoft.netcore.app\1.1.2

    I am not sure which is correct here, the SDK version of the converted project or SDK version of the newly added project?

    Infact if create a brand new project in VS 2017 i see its Dependencies -> SDK ->Microsoft.NETCore.App -> Properties version is 1.1.2

    1.1.2 SDK not even SDK available. Why VS 2017 shows runtime version as SDK version

    is this a bug in VS 2017?