VS2017 : Target framework drop down does not show .NET Core 2.1 option

前端 未结 8 1603
暖寄归人
暖寄归人 2021-02-05 02:36

I have already installed VS2017 Enterprise 15.6.4. Recently installed .NET Core 2.1.101 SDK from official site

I was expecting .NET Core

相关标签:
8条回答
  • 2021-02-05 03:17

    I was facing the similar issue, I uninstalled the .Net Core 2.2 runtime and then from the below link:

    https://dotnet.microsoft.com/download/visual-studio-sdks?utm_source=getdotnetsdk&utm_medium=referral

    Install the .Net Core 2.2 Visual Studio SDK, Restarted the Visual Studio and my issue got resolved, .Net Core 2.2 is now getting listed in Target Framework list in the project properties in Visual Studio 2017 Version 15.9.16

    0 讨论(0)
  • 2021-02-05 03:19

    I have faced the same problem. I solved this by installing the right SDKs with Runtime for .NET Core 2.1.

    Basically to run/create 2.1 projects from VS Preview, you need to install the "2.1.300" (not 2.1.4) .NET Core SDKs and Runtime. https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300-preview1 (this includes required Runtime already)

    The good explanation of this misleading with versions i found here https://github.com/dotnet/cli/issues/8309 (dasMulli commented on Feb 24).

    0 讨论(0)
  • 2021-02-05 03:21

    I had faced the similar issue. I then just updated my Visual Studio 2017 to 15.9.16 version and restarted the system. The problem got resolved.

    0 讨论(0)
  • 2021-02-05 03:22

    I have faced the similar situation I tried to install the preview version of the dot net but it did not help. However after I updated visual studio (from 15.8 to 15.9.6 ). I Could see dot net core 2.1 in the target framework.

    0 讨论(0)
  • 2021-02-05 03:31

    In case this helps someone else... After installing VS 15.9.2 my project that was working fine with 2.2 preview-3 stopped working. VS could not see the preview SDK. I could build the solution using dotnet.exe but not VS.

    To solve this I created a global.json at the root folder of this solution pointing to the preview sdk. That allowed VS to see the preview version.

    This is a change of behavior in VS between 15.8.x and 15.9.x.

    To create the global.json you can navigate to the desired folder and type this:

    dotnet new globaljson

    0 讨论(0)
  • 2021-02-05 03:37

    Make sure dotnet PATH variables are in correct order

    If you have installed an SDK for a different system architecture (e.g., if you installed 32-bit/x86 SDK on a 64-bit computer), then a new entry in the PATH variable would have been created for that specific location (e.g., C:\Program Files\dotnet or C:\Program Files (x86)\dotnet).

    The problem is that Visual Studio, when searching for installed frameworks, will stop at the first PATH variable entry it finds that contains an SDK. So, if the first version you installed used an incorrect architecture, then you'll have to adjust the position of those entries before any of the correct SDKs will appear in the Target Framework drop down.

    Source: this absurdly-hard-to-find comment within issue #8309.


    TL;DR: Make sure the first "C:\Program Files\dotnet\" entry in your path variable you see in the list matches your system architecture:

    • 64-bit = C:\Program Files\dotnet\
    • 32-bit = C:\Program Files (x86)\dotnet\
    0 讨论(0)
提交回复
热议问题