为什么Visual Studio无法找到此nuget包的.props文件? [英] Why can't Visual Studio find this nuget package's .props file?

查看:268
本文介绍了为什么Visual Studio无法找到此nuget包的.props文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队不得不移动到新的git实例.足以从旧服务器迁移所有分支的家伙错过了我正在使用的功能分支.我作弊的解决方案是将我在旧功能分支中添加的项目复制到我的桌面上,克隆新的回购,创建一个新的功能分支,将.csproj和所有.cs文件复制到适当位置的目录中,然后从解决方案资源管理器中添加现有项目.

My team had to move to a new git instance. The guy that was goodly enough to migrate all the branches from our old server missed a feature branch I'm working in. My cheat-y solution was to copy the project I had added in my old feature branch to my desktop, clone the new repo, make a new feature branch, copy the .csproj and all the .cs files into the directory at the appropriate place, then add the existing project from the solution explorer.

当我尝试构建时,出现错误:

When I try to build, I get an error:

此项目引用了此计算机上缺少的NuGet软件包.使用NuGet软件包还原下载它们.有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105 .丢失的文件是.. \ packages \ MSTest.TestAdapter.1.1.11 \ build \ net45 \ MSTest.TestAdapter.props.

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 ..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.props.

对该项目的引用包含四个缺少的引用,其中两个(Microsoft.VisualStudio.TestPlatform.TestFramework和Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions)似乎相关.其他两个,如果证明是相关的话,分别是System和System.Core,但它们不会引起任何问题...这很奇怪,因为我正在使用它们.

The references to the project contain four missing references, two of which (Microsoft.VisualStudio.TestPlatform.TestFramework, and Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions) seem to be related. The other two, in case it proves to be relevant are System, and System.Core, but they aren't causing any problems... which is weird, cause I'm deffo using them.

无论如何...该文件(错误消息中的那个文件)绝对存在.我尝试卸载并重新安装两个软件包,但似乎无济于事.谁能告诉我我想念的东西吗?

Anyway... that file, the one from the error message, is absolutely there. I've tried to uninstall and reinstall both packages, but nothing seems to help. Can anyone tell me what I'm missing?

推荐答案

使用您喜欢的文本编辑器打开项目.csproj文件,并删除对

Open the projects .csproj file with your favourite text editor and delete any references to

MSTest.TestAdapter.props.

MSTest.TestAdapter.props.

这样做是安全的,所有发生的事情是您删除了DLL,但是由于某种原因或其他原因,您的项目文件仍将其引用为依赖项.

This is safe to do so, all that happened is that you have removed the DLL but for one reason or another your project file still references it as a dependency.

这篇关于为什么Visual Studio无法找到此nuget包的.props文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆