MSBuild NuGet.targets,Nuget.exe:无法从路径“blah.nupkg"错误读取包 [英] MSBuild NuGet.targets ,Nuget.exe : Unable to read package from path 'blah.nupkg' error

查看:27
本文介绍了MSBuild NuGet.targets,Nuget.exe:无法从路径“blah.nupkg"错误读取包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行 MSBuild 构建步骤以在 TeamCity 中构建 Web 项目时遇到这些错误,并且我已将 Nuget 目标 文件 PackageSource 设置为指向本地 Nuget 服务器例如PackageSource Include="http://mylocaldevurl/nuget/Packages" .

I am getting these errors when running a MSBuild build step that builds a web project in TeamCity and I have setup my Nuget targets file PackageSource to point to a local Nuget server e.g. PackageSource Include="http://mylocaldevurl/nuget/Packages" .

构建运行并产生以下形式的错误例如Exec] F:TeamCityuildAgentworklahblah.nugetNuGet.targets(87, 9):无法从路径 'Lucene.Net.3.0.3.nupkg' 读取包.

The build runs and produces errors of the form e.g. Exec] F:TeamCityuildAgentworklahblah.nugetNuGet.targets(87, 9): Unable to read package from path 'Lucene.Net.3.0.3.nupkg'.

奇怪的是,其他包被很好地下载到 TeamCity 工作文件夹 - 包文件夹.

Whats is strange other packages are downloaded fine to the TeamCity working folder -the package folder.

本地 Nuget 服务器包含我的 VS 解决方案包的副本(默认包文件夹中的那些),只有 .nupkg 文件.

The local Nuget Server contains copies of my VS solution packages(the ones in the default packages folder) with only the .nupkg files.

我的问题是在将 .nupkg 文件复制到该服务器时需要做些什么.我可能会遗漏一些东西.

My question is there something that I need to do when copying the .nupkg files to that server.I might be missing something.

我已经仔细检查了本地服务器中是否存在包

I have already doubled checked that the packages exist in the local Server

推荐答案

我在使用 TFS 时遇到了同样的问题.我所做的修复是清除正在运行构建的用户配置文件中的 nuget 缓存(%LocalAppData%NuGetCache).我只是清空了目录并再次运行构建,然后它工作了.

I had this same problem using TFS. What I did that fixed it was clear the nuget cache in the user profile that was running the build (%LocalAppData%NuGetCache). I just emptied the directory and ran the build again, then it worked.

这篇关于MSBuild NuGet.targets,Nuget.exe:无法从路径“blah.nupkg"错误读取包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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