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?
I had the same error message. In my case. I had to install the .NET Core cross-platform development toolset.
Steps:
I got the same issue. I could not create new ASP .Net Core 2 on fresh installed VS2017 or open existing one, which works perfectly on another computer with VS2017.
It's started work for me after uninstalling all .NET Core Runtimes and .NET Core Windows Server Hosting from Windows. SDKs have been left only and all works finally.
Probably, I needed to uninstall just .NET Core Runtimes or .NET Core Windows Server Hosting from Windows and it would be enough.
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!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.
I have solved this problem a couple of times lately by closing Visual Studio and running the following commands
There seems to be times, especially at the beginning of projects, when nuget gets out of whack (technical term).
Thanks guys, i had reinstall older version of visual studio 2017 and it works well. My VS version is 15.4 and it's fine