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
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.
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.
Turns out my project was dependent on another project in the solution, which had failed NuGet dependency issues, which in turn was because the Target Framework in the project properties was blank.
I opened the .csproj
file to check the target framework, downloaded the target framework and chose "repair", then restarted Visual Studio and all good again!
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.
Eh, rookie mistake, I had Visual Studio SSDT open and was trying to open an existing .Net Core project which produces the same error:
"Project file is incomplete. Expected imports are missing"
The solution was to use Visual Studio not SSDT, see in Help > About:
The only thing that worked for me was to upgrade Visual studio: