Why can't Visual Studio find this nuget package's .props file?

隐身守侯 提交于 2019-12-23 08:26:30

问题


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:

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.

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?


回答1:


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

MSTest.TestAdapter.props.

Edit: 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.



来源:https://stackoverflow.com/questions/47042836/why-cant-visual-studio-find-this-nuget-packages-props-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!