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?
Eh, rookie mistake, I had Visual Studio SSDT open and was trying to open an existing .Net Core project which produces the same error:
The solution was to use Visual Studio not SSDT, see in Help > About:
After installing VS2019 I started to have the same error when opening existing .Net Core solutions in VS2017.
In Visual Studio Installer I've updated VS2017 to the latest version (15.9.11) and the problem disappeared.
Later after upgrading VS2019 to the latest release I started to have the same errors and had to upgrade VS2017 again.
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.
Run dotnet restore on command line for the solution.
Tip. If you've uninstalled the latest .net core version let's say 2.1.403 and installed the previous one, ensure the 2.1.403 folder has been actually removed at the path
C:\Program Files\dotnet\sdk\
I had the issue due to there left an empty folder with 2.1.403
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
I had the same issue. In my case, deleting global.json and appsettings solved the problem.