[英]File was not found after nuget restore
I am using Visual Studio 2017 and pull the source code from TFS server, then build the solution, I got the following error: 我正在使用Visual Studio 2017并从TFS服务器中提取源代码,然后构建解决方案,出现以下错误:
Microsoft.Common.CurrentVersion.targets (3863,5): Error MSB3113: The file "SqlServerTypes \\ x64 \\ SqlServerSpatial140.dll" was not found. Microsoft.Common.CurrentVersion.targets(3863,5):错误MSB3113:找不到文件“ SqlServerTypes \\ x64 \\ SqlServerSpatial140.dll”。
Then I found this dll file comes from the nuget package sqlserver.types, as I know, Visual Studio will restore the nuget packages when we build the solution. 然后我发现此dll文件来自nuget包sqlserver.types,据我所知,Visual Studio将在构建解决方案时还原nuget包。
Why I still have this issue? 为什么我仍然有这个问题?
您可以尝试以下方法:
Update-Package <package_name> –reinstall
File was not found after nuget restore nuget恢复后找不到文件
When you download the nuget package Microsoft.SqlServer.Types
from the nuget.org and open it with nuget package explorer: 当您下载NuGet包Microsoft.SqlServer.Types
从nuget.org与NuGet包Explorer中打开它:
You will find the sqlserver.types
nuget package not only includes .dll
from .net framework, but also has native binaries files. 您会发现sqlserver.types
nuget软件包不仅包含.net框架中的.dll
,而且还具有本机二进制文件。 These files are designed with x64 and x84, they could not added to lib folder directly. 这些文件是使用x64和x84设计的,因此无法直接添加到lib文件夹中。 So the package owner adds them to project as content. 因此,包所有者将它们作为内容添加到项目中。 However, these dll files is setting to ignore by default for TFS, you need to add them manually. 但是,对于TFS,这些dll文件默认设置为忽略,您需要手动添加它们。
Of course, you can also use the command line Update-Package <package_name> –reinstall
to reinstall this nuget package, but this requires you to execute this command every time after you pull the code from the TFS server. 当然,您也可以使用命令行Update-Package <package_name> –reinstall
重新安装此nuget软件包,但这要求您每次从TFS服务器提取代码后都执行此命令。 Add this native binaries to the source control will Will reduce these unnecessary troubles. 将此本机二进制文件添加到源代码管理中将减少这些不必要的麻烦。
Hope this helps. 希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.