简体   繁体   中英

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:

Microsoft.Common.CurrentVersion.targets (3863,5): Error MSB3113: The file "SqlServerTypes \\ x64 \\ SqlServerSpatial140.dll" was not found.

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.

Why I still have this issue?

您可以尝试以下方法:

Update-Package <package_name> –reinstall

File was not found after nuget restore

When you download the nuget package Microsoft.SqlServer.Types from the nuget.org and open it with nuget package explorer:

在此处输入图片说明

You will find the sqlserver.types nuget package not only includes .dll from .net framework, but also has native binaries files. These files are designed with x64 and x84, they could not added to lib folder directly. 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.

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. Add this native binaries to the source control will Will reduce these unnecessary troubles.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM