简体   繁体   English

由于缺少 NuGet 引用而无法构建解决方案

[英]Can't build solution because of missing NuGet references

Like title says, I can not build my solution(C#) as NuGet is spitting out this error正如标题所说,我无法构建我的解决方案(C#),因为 NuGet 正在吐出这个错误

This project references NuGet package(s) that are missing on this computer.此项目引用此计算机上缺少的 NuGet 包。 Use NuGet Package Restore to download them.使用 NuGet Package Restore 来下载它们。 For more information, see http://go.microsoft.com/fwlink/?LinkID=322105 .有关详细信息,请参阅http://go.microsoft.com/fwlink/?LinkID=322105 The missing file is ..\\packages\\Fody.1.26.1\\build\\Fody.targets.丢失的文件是 ..\\packages\\Fody.1.26.1\\build\\Fody.targets。

When I run Get-Package, it says no packages are installed.当我运行 Get-Package 时,它​​说没有安装任何软件包。 How do I get rid of this(I have no need for the package anymore).我如何摆脱这个(我不再需要这个包了)。

Thanks谢谢

You don't want to use the project based nuget package restore!您不想使用基于项目的 nuget 包还原!

Make sure you have the latest Nuget version (Tools -> Extensions and Updates)确保您拥有最新的 Nuget 版本(工具 -> 扩展和更新)

When you go to build the project it should tell you it needs to download the nuget packages (or might just auto download them).当你去构建项目时,它应该告诉你它需要下载 nuget 包(或者可能只是自动下载它们)。

Edit not sure whats with the downvotes:编辑不确定什么是downvotes:

http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html

To find the menu item: "enable nuget package restore" right-click in the solution explorer on the solution - not on the project.要找到菜单项:“启用 nuget 包还原”在解决方案资源管理器中右键单击解决方案 - 而不是在项目上。

You get a message:你收到一条消息:

Do you want to configure this solution to download and restore missing NuGet packages during build?是否要配置此解决方案以在构建期间下载和恢复丢失的 NuGet 包?

Press Ctrl+Q then type "Package Manager Console", This will bring up a console like interface.按 Ctrl+Q 然后输入“Package Manager Console”,这将显示一个类似控制台的界面。

Type in输入

Uninstall-Package Fody

and press enter will remove this package for you然后按回车键会为你删除这个包

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 由于“缺少”引用而无法构建发布配置 - Can't build release configuration because of 'missing' references NuGet软件包还原失败并显示错误消息-无法构建解决方案 - NuGet Package Restore fails with error message - can't build solution 卸载所有 Nuget 包后,构建失败,因为找不到 project.assets.json 文件 - After uninstalling all Nuget packages, build fails because it can't find project.assets.json file 解决方案将无法构建,因为它无法从服务生成类型转换为我的类型 - Solution won't build because it can't convert from service generated type to my type 在同一解决方案中找不到引用 - Can't find references in the same solution 为什么 do.net 构建在 .NET Framework 4.5 项目上会抛出“该项目引用了 NuGet 缺少的包”? - Why does dotnet build on a .NET Framework 4.5 project throw "This project references NuGet package(s) that are missing"? Xamarin Build Error Compilation can't be completed because some library classes are missing - Xamarin Build Error Compilation can't be completed because some library classes are missing 即使是C#winforms应用程序,由于缺少Android SDK也无法构建解决方案吗? - Can't build solution due to Android SDK missing even though it's a C# winforms application? SignalR引用缺少的NuGet软件包 - SignalR references NuGet package(s) that are missing Nuget无法建立依存关系图,因此无法运作 - Nuget can't build dependency graph, so can't work
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM