The current .NET SDK does not support targeting .NET Standard 2.0 error in Visual Studio 2017 update 15.3

前端 未结 14 2499
南旧
南旧 2020-12-13 05:07

I want to create a class library project with Target Framework .NET Standard 2.0.

I\'ve updated my Visual Studio 2017 to Version 15.3 and

相关标签:
14条回答
  • 2020-12-13 05:43

    I had the same problem as the current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 1.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.1

    1) Make sure .Net core SDK installed on your machine. Download .NET!

    2) set PATH environment variables as below Path

    0 讨论(0)
  • I had this issue while trying to build my solution in TFS. We were using "dot net publish" task. Using msbuild broke the ice for us.

    0 讨论(0)
  • 2020-12-13 05:50

    It sounds like installing the VS2017 update for that specific version didn't also install the .NET Core 2.0 SDK. You can download that here.

    To check which version of the SDK you've already got installed, run

    dotnet --info
    

    from the command line. Note that if there's a global.json file in either your current working directory or any ancestor directory, that will override which version of the SDK is run. (That's useful if you want to enforce a particular version for a project, for example.)

    Judging by comments, some versions of VS2017 updates do install the .NET Core SDK. I suspect it may vary somewhat over time.

    0 讨论(0)
  • 2020-12-13 05:50

    I had installations of both Visual Studio 2019 and 2017. I tried installing the .NET Core 2.X SDK for VS2017 separately but with no luck.

    The issue is, that I have .NET Core 3.0 SDK installed as default sdk-version, which VS2017 does not like.

    My solution was to switch the SDK version for the specific project.

    • First, list your installed SDK's to find the desired version:
    $ dotnet --info
    
    .NET Core SDK (reflecting any global.json):
     Version:   3.1.100
     Commit:    cd82f021f4
    
    Runtime Environment:
     OS Name:     Windows
     OS Version:  10.0.18362
     OS Platform: Windows
     RID:         win10-x64
     Base Path:   C:\Program Files\dotnet\sdk\3.1.100\
    
    Host (useful for support):
      Version: 3.1.0
      Commit:  65f04fb6db
    
    .NET Core SDKs installed:
      1.1.14 [C:\Program Files\dotnet\sdk]
      2.1.202 [C:\Program Files\dotnet\sdk]
      2.1.509 [C:\Program Files\dotnet\sdk]
      2.2.110 [C:\Program Files\dotnet\sdk]
      3.0.100 [C:\Program Files\dotnet\sdk]
      3.1.100 [C:\Program Files\dotnet\sdk]
    
    • From your solution directory:
    $ dotnet new globaljson --sdk-version 2.2.110 --force
    

    Now, dotnet will use the specified SDK version for this solution.

    I have not found a way to do this system-wide without also messing up my 3.0 projects.

    0 讨论(0)
  • 2020-12-13 05:51

    while the above answers didn't solve my problem. I finally solved it by specifically going to this link https://www.microsoft.com/net/download/visual-studio-sdks and download the required sdk for Visual Studio. It was really confusing and i don't understand why but that solved my problem

    0 讨论(0)
  • I just had this with 15.8.3 after uninstalling some .NET Core 1.x preview SDKs, my application would not compile and showed the error.

    It was fixed by installing the latest x86 version of the SDK even though I'm on Windows 10 x64.

    I presume this is because VS 2017 is still a x86 program and though the programs run as x64 the compiler was looking for an appropriate x86 SDK

    0 讨论(0)
提交回复
热议问题