Project file is incomplete. Expected imports are missing

后端 未结 30 1784
深忆病人
深忆病人 2020-12-07 19:30

After format my computer I reinstalled Vs 2017 V 15.6.3 and install ASP.Net Core SDK from Microsoft 2.1.4

But when I create new asp core application VS failed with e

相关标签:
30条回答
  • 2020-12-07 20:12

    in my case, I went to the folder C:\Program Files\dotnet\sdk delete the preview sdk folder, then on the command line run:

    dotnet sdk 2.1.200

    to set the correct sdk version for asp.net core. this fixed the problem.

    0 讨论(0)
  • 2020-12-07 20:13

    You can check global.json file which you can find in solution root directory and make sure that the target SDK version in it installed on your machine or update it to one you already have it installed for example if you have SDK version 2.1.4 installed your global.json should look like this

    {
      "sdk":
      {
        "version": "2.1.400"
      }
    }   
    
    0 讨论(0)
  • 2020-12-07 20:13

    I was facing the same issue. I was running my project on .Net core 2.2. I tried every single solution given here but nothing worked. I repaired my visual studio and it's working fine now.

    0 讨论(0)
  • 2020-12-07 20:14

    I solved this problem by modifying the first line in the .csproj file from:

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

    to:

    <Project Sdk="Microsoft.NET.Sdk">
    
    0 讨论(0)
  • 2020-12-07 20:16

    Thanks guys, i had reinstall older version of visual studio 2017 and it works well. My VS version is 15.4 and it's fine

    0 讨论(0)
  • 2020-12-07 20:16

    This happened to me when I uninstalled a VS2015 instance of Visual Studio I had running side by side with VS2017.

    I had to go out and reinstall the .Net Core sdk/runtime with the x86 version. I had already manually done the x64 versions of these but didn't think about visual studio running in 32bit.

    These are the files:

    • dotnet-sdk-x.x.x-win-x86.exe

    • DotNetCore.x.x.x-WindowsHosting.exe

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