Project file is incomplete. Expected imports are m

2020-02-02 06:41发布

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 error

"Project file is incomplete. Expected imports are missing"

Please, can anyone help?

Error after while creating ASP core application

30条回答
我命由我不由天
2楼-- · 2020-02-02 06:53

Repairing last Core installation worked for me

查看更多
Viruses.
3楼-- · 2020-02-02 06:54

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

查看更多
劳资没心,怎么记你
4楼-- · 2020-02-02 06:54

I have resolved it by updating visual studio to 2017 version.

The actual problem was that .net core version was later than Visual Studio.

Go to Help> Check for update, update Visual Studio.

查看更多
闹够了就滚
5楼-- · 2020-02-02 06:55

I just had the same issue while installing the new preview version of VS 2019. I fixed it by uninstalling the latest update which in turn uninstalled the most recent downloaded version of core. Which I belive caused the missmatch.

查看更多
贪生不怕死
6楼-- · 2020-02-02 06:56

The only thing that worked for me was to upgrade Visual studio:

enter image description here

enter image description here

查看更多
Anthone
7楼-- · 2020-02-02 06:56

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

查看更多
登录 后发表回答