构建错误,此项目引用 NuGet

Build error, This project references NuGet(构建错误,此项目引用 NuGet)
本文介绍了构建错误,此项目引用 NuGet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试构建我的解决方案时,我收到以下错误消息:

When I try to build my solution, I get the following error message:

严重性代码描述项目文件行抑制状态错误此项目引用了缺少的 NuGet 包这台电脑.使用 NuGet 包还原下载它们.更多信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105.这丢失的文件是..packagesMicrosoft.Net.Compilers.1.1.1uildMicrosoft.Net.Compilers.props.MusicKarma C:UsersBryanDocumentsVisual工作室 2015ProjectsMusicKarmaMusicKarma.csproj 268

Severity Code Description Project File Line Suppression State Error This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..packagesMicrosoft.Net.Compilers.1.1.1uildMicrosoft.Net.Compilers.props. MusicKarma C:UsersBryanDocumentsVisual Studio 2015ProjectsMusicKarmaMusicKarma.csproj 268

当我查看我的包文件夹时,我可以找到名为 Microsoft.Net.Compilers.props 的文件

When I look In my packages folder, I can find I file named Microsoft.Net.Compilers.props

我曾尝试使用 Nuget Restore,但它一直说我拥有所有软件包.

I have tried to use Nuget Restore, but it keeps saying that I have all the packages.

当我将此项目从 TFS 带到我的一台计算机时,就会发生这种情况.

This happens when I take this project from TFS to one of my computers.

推荐答案

首先我会检查您的 MusicKarma 项目的 packages.config 文件中是否包含 Microsoft.Net.Compilers.如果没有,那么您可以从 MusicKarma.csproj 中删除与该 NuGet 包有关的所有内容.

First I would check if your MusicKarma project has Microsoft.Net.Compilers in its packages.config file. If not then you could remove everything to do with that NuGet package from your MusicKarma.csproj.

如果您使用的是 Microsoft.Net.Compilers NuGet 包,那么我的猜测是路径不正确.查看错误消息中的目录名称,我猜 MusicKarma 解决方案文件 (.sln) 与 MusicKarma.csproj 位于同一目录中.如果是这样,那么包目录可能是错误的,因为默认情况下,包目录将位于解决方案目录中.所以我假设你的包目录是:

If you are using the Microsoft.Net.Compilers NuGet package then my guess is that the path is incorrect. Looking at the directory name in the error message I would guess that the MusicKarma solution file (.sln) is in the same directory as the MusicKarma.csproj. If so then the packages directory is probably wrong since by default the packages directory would be inside the solution directory. So I am assuming that your packages directory is:

C:UsersBryanDocumentsVisual Studio 2015ProjectsMusicKarmapackages

当您的 MusicKarma.csproj 文件在以下位置寻找道具文件时:

Whilst your MusicKarma.csproj file is looking for the props file in:

C:UsersBryanDocumentsVisual Studio 2015ProjectspackagesMicrosoft.Net.Compilers.1.1.1uild

如果是这种情况,您可以通过编辑 MusicKarma.csproj 文件中的路径或重新安装 NuGet 包来解决问题.

So if that is the case then you can fix the problem by editing the path in your MusicKarma.csproj file or by reinstalling the NuGet package.

这篇关于构建错误,此项目引用 NuGet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)