加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 在Microsoft.Net.Compilers上添加依赖项后无法加载Visual

发布时间:2020-12-15 23:35:26 所属栏目:百科 来源:网络整理
导读:我的项目依赖于NuGet包Microsoft.Net.Compilers: package id="Microsoft.Net.Compilers" version="1.3.2" targetFramework="net461" developmentDependency="true" / 但是,如果我在清除package文件夹后加载Visual Studio,我的项目将不会加载以下错误: The
我的项目依赖于NuGet包Microsoft.Net.Compilers:

<package id="Microsoft.Net.Compilers" version="1.3.2" 
         targetFramework="net461" developmentDependency="true" />

但是,如果我在清除package文件夹后加载Visual Studio,我的项目将不会加载以下错误:

The imported project “C:MyServicepackagesMicrosoft.Net.Compilers.1.3.2toolsMicrosoft.CSharp.Core.targets” was not found. Confirm that the path in the declaration is correct,and that the file exists on disk.
C:Program Files (x86)MSBuild14.0binMicrosoft.CSharp.CurrentVersion.targets

所以它不会加载项目,因为它缺少一个使用Nuget在构建时恢复的文件,只有在我可以加载项目时它才有效.

解决方法

您可以使用Nuget命令行工具恢复您的包.如果你的系统还没有它,你可以在这里找到它: https://www.nuget.org/

在命令行上发出以下命令:

nuget restore

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读