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条回答
Fickle 薄情
2楼-- · 2020-02-02 07:03

I had the same problem with an ASP.net Core 2.0 project after I've installed the DotNetCore.2.0.5-WindowsHosting Framework on my development machine. I could solve this problem after I've deinstalled the WindowsHosting Framework and all .net Core packages. After this I've reinstalled the dotnet-sdk-2.1.200-win-x64 package and everything worked fine.

查看更多
forever°为你锁心
3楼-- · 2020-02-02 07:04

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.

查看更多
孤傲高冷的网名
4楼-- · 2020-02-02 07:05

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.

查看更多
迷人小祖宗
5楼-- · 2020-02-02 07:06

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">
查看更多
再贱就再见
6楼-- · 2020-02-02 07:07

Same issue...took me a while to figure out. Since I was working on an ASP.NET Core project that targeted .NET Core 1.1, I thought I still needed the .NET Core 1.1 SDK installed. Since I had .NET Core SDK 2.1 installed too there was some sort of conflict and I couldn't open the project file. After uninstalling .NET Core 1.1 I was then able to open my project.

查看更多
甜甜的少女心
7楼-- · 2020-02-02 07:08

Delete all build generated bin and obj folders. This worked for me after renaming project and trying to reload solution. Not really sure about the real cause of incompatible loading.

查看更多
登录 后发表回答