Project file is incomplete. Expected imports are missing

后端 未结 30 1812
深忆病人
深忆病人 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:22

    Just need to cross check your project creation .net core library version with updated one.When you update core library it won't get updated into .csproj, either you need to update it manually or need to remove latest/updated core sdk file.

    To check .net core version --fire command on cmd :- dotnet --version

    Then check with installed library in Program and Features --Removing of latest library resolve the problem without change of single line

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

    I had the same symptoms from a corrupted dotnet core SDK (from the command line I was unable to run dotnet -v, where previously I was able). My project failed to load after a failed IIS web platform installation failure. Reinstalling .NET core SDK resolved the issue.

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

    Deleting the bin and obj folders for the project fixed this for me.

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

    Resolved

    1. Even after uninstalling certain version from control panel, there would the files and folders with deleted version found in C:\Program Files\dotnet\sdk

    2. Please go and delete unwanted version folder

    3. Try reloading the project

    This worked for me

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

    In my case, I had two versions of Visual Studio installed (15.7 and 15.6). 15.7 didn't have the web workloads installed, though .net core 2.1 RC1 was already installed. I installed the asp.net workload into VS2017, and then repaired my .net core install for good measure. Definitely something in this process swapped my c:\program files(x86)\dotnet and c"\program files\dotnet in this path and Visual Studio (15.7) wouldn't open my web project.

    I simply edited the System Environment variables, moved the x86 folder down one and voila - reopened Visual Studio and it now loaded my project.

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

    I had the same issue. took me quiet a while to figure it out. In my case, I was trying to open a new ASP .NET Core Application and I was getting back 0 Projects like the one on this post.

    What I tried: I tried changing environmental variables under Control Panel\System and Security\System (click advance settings)

    Then click Environmental Variables

    Then check to see if you have dotnet path included, whether it is under Program Files or Program files (x86)

    Some people suggested to move (x86) up, which is based on microsoft documentation

    What fixed my issue: Turns out I had the wrong version installed and it was not compatible with Visual Studio 2017

    Then I removed the other installations and reinstalled the right version that is compatible with VS17 and works like a magic. Hope it helps someone in the future.

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