Project file is incomplete. Expected imports are missing

后端 未结 30 1815
深忆病人
深忆病人 2020-12-07 19:30

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

相关标签:
30条回答
  • 2020-12-07 20:17

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

    0 讨论(0)
  • 2020-12-07 20:17

    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.

    0 讨论(0)
  • 2020-12-07 20:18

    I get the same issue, and I run Visual with Administrator privilege again. This helps me to open project nomarlly.

    0 讨论(0)
  • 2020-12-07 20:19

    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.

    0 讨论(0)
  • 2020-12-07 20:19

    I started to get this error when unistalled all my old .NET Core SDKs and installed the latest one, 2.1.5 at the time of posting. I have tried all the solutions here without any luck so decided to check what is the current SDK version after all the cleaup I did because I thought this is causing the problem, and I was right - started a command prompt and wrote dotnet --version and got the message "Did you mean to run dotnet SDK commands? Please install dotnet SDK from:". Strange, the SDK is installed but the system doesn't see it. Then I looked in my environment variables and the PATH variable had the x86 for dotnet path before the regular Program Files (the x64 one) path. So I moved the x64 before the x86 and voila, everthing is back to normal.

    Hope I helped someone.

    0 讨论(0)
  • 2020-12-07 20:20

    I had the same error message. In my case. I had to install the .NET Core cross-platform development toolset.

    Steps:

    1. In Visual Studio, go to Tools > Get Tools and Features...
    2. Modify the installation under Workloads: select .NET Core cross-platform development and click Modify.
    3. Restart VS and rebuild your project.
    0 讨论(0)
提交回复
热议问题