Project file is incomplete. Expected imports are missing 错误解决方案

Posted shanyou

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Project file is incomplete. Expected imports are missing 错误解决方案相关的知识,希望对你有一定的参考价值。

当你打开一个.net core的项目,Visual Studio 可能无法打开,提示如下错误:

D:workshopGithubOcelotsrcOcelotOcelot.csproj : error  : Project file is incomplete. Expected imports are missing.

D:workshopGithubOcelot estOcelot.UnitTestsOcelot.UnitTests.csproj : error  : Project file is incomplete. Expected imports are missing.

D:workshopGithubOcelot estOcelot.AcceptanceTestsOcelot.AcceptanceTests.csproj : error  : Project file is incomplete. Expected imports are missing.

D:workshopGithubOcelot estOcelot.ManualTestOcelot.ManualTest.csproj : error  : Project file is incomplete. Expected imports are missing.

D:workshopGithubOcelot estOcelot.BenchmarksOcelot.Benchmarks.csproj : error  : Project file is incomplete. Expected imports are missing.

D:workshopGithubOcelot estOcelot.IntegrationTestsOcelot.IntegrationTests.csproj : error  : Project file is incomplete. Expected imports are missing.

D:workshopGithubOcelotsrcOcelotOcelot.csproj : error  : Project file is incomplete. Expected imports are missing.

这个错误的原因是项目通过global.json 指定了项目的SDK版本,比如Ocelot的global.json 指定了2.1.301

{
   "projects": [ "src", "test" ],
   "sdk": {
     "version": "2.1.301"
   }
}

我的机器上没有安装这个版本的SDK,解决方法就是安装这个版本的SDK。






以上是关于Project file is incomplete. Expected imports are missing 错误解决方案的主要内容,如果未能解决你的问题,请参考以下文章

incomplete type is not allowed

WebGL渲染错误:GL_INVALID_FRAMEBUFFER_OPERATION: Draw framebuffer is incomplete

WebGL渲染错误:GL_INVALID_FRAMEBUFFER_OPERATION: Draw framebuffer is incomplete

CDH大数据平台 安装superset常见错误汇总Could not import the lzma module. Your installed Python is incomplete

log file switch (checkpoint incomplete)

Flutter 常见问题三十七Cannot Save Settings:The Flutter SDK installation is incomplete