Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project file is incomplete. Expected imports are missing

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

like image 853
Majd Albaho Avatar asked Mar 22 '18 15:03

Majd Albaho


3 Answers

I had the same issue. In my case, deleting global.json and appsettings solved the problem.

like image 140
PilgrimViis Avatar answered Nov 14 '22 12:11

PilgrimViis


Another potential cause is you installed a .NET Core version which is incompatible with Visual Studio. This might be unrelated to the original question by the OP, since it concerns different version numbers, but since I landed on this page while looking for help I thought this might be useful to others.

At the time of writing, I installed .NET Core 2.2.203 which is not compatible with Visual Studio 2017 (Professional 15.9.11).

The .NET Core download page lists a separate download for Visual Studio 2017. Be sure to download this one when you intend to use Visual Studio 2017. The current supported version is .NET Core 2.2.106.

like image 41
Steven Jeuris Avatar answered Nov 14 '22 11:11

Steven Jeuris


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"
  }
}   
like image 26
Smart Dev Avatar answered Nov 14 '22 11:11

Smart Dev