无法解析此引用:CI的NuGet服务器上 [英] Could not resolve this reference: NuGet on CI server

查看:391
本文介绍了无法解析此引用:CI的NuGet服务器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在TFS构建控制器,连接到VS在线运行的CI构建。我有一个'无法解析此引用问题的的NuGet包,我已经注意到,我以前没有见过的行为:

I'm running a CI build on a TFS build controller, connected to VS Online. I've got a 'Could not resolve this reference' problem for a NuGet package and I've observed behavior that I haven't seen before:

在本地pacakage下载到包\ FluentValidation.5.5.0 ,而在服务器上,它下载到包\ FluentValidation.5.5.0.0

Locally the pacakage is downloaded to packages\FluentValidation.5.5.0 whereas on the server, it's downloaded to packages\FluentValidation.5.5.0.0.

Packages.config:

Packages.config:

<package id="FluentValidation" version="5.5.0" targetFramework="net45" userInstalled="true" />

.csproj的文件 $(SolutionDir)共享项目 - 适用于所有其他项目:

.csproj file $(SolutionDir) for shared project - works for all the other projects:

<Reference Include="FluentValidation, Version=5.5.0.0, Culture=neutral, processorArchitecture=MSIL">     
<HintPath>$(SolutionDir)\packages\FluentValidation.5.5.0\lib\Net40\FluentValidation.dll</HintPath>
  <SpecificVersion>False</SpecificVersion>
  <Private>True</Private>
</Reference>

的NuGet包恢复启用,所以如果我在本地从包文件夹中删除包和重建 - 正常工作

Nuget package restore is enabled, so if I locally remove the package from the packages folder and rebuild - works fine.

现在的CI服务器上。建立诊断日志状态:

Now on the CI server. Build diagnostics log states:

安装FluentValidation 5.5.0.0。   ...   成功安装FluentValidation 5.5.0.0。

Installing 'FluentValidation 5.5.0.0'. ... Successfully installed 'FluentValidation 5.5.0.0'.

但随后进一步构建日志:

But then further in build log:

16> C:\ Program Files文件   (86)\的MSBuild \ 12.0 \ BIN \ AMD64 \ Microsoft.Common.CurrentVersion.targets(1697,5):   警告MSB3245:无法解析此引用。无法找到   装配FluentValidation。检查以确保大会   存在于磁盘上。如果此引用需要由您code,你可能   出现编译错误。 [C:\构建\ 24353 ......东西...... \ projectfile.csproj]                    对于SearchPath中的{} HintPathFromItem。                    被认为是C:\构建\ 24353 ......东西...... \包\ FluentValidation.5.5.0 \ lib目录\ Net40 \ FluentValidation.dll

16>C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "FluentValidation". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Builds\24353... stuff...\projectfile.csproj] For SearchPath "{HintPathFromItem}". Considered "C:\Builds\24353... stuff ...\packages\FluentValidation.5.5.0\lib\Net40\FluentValidation.dll",

正如预期的那样 - 有没有包,文件夹

As expected - there's not package in that folder

C:\构建\ 24353 \ ......东西...... \包\ FluentValidation.5.5.0 \ lib目录\ Net40 \

但是 - 这是因为它被下载到CI服务器上的不同文件夹:

However - that's because it is downloaded into a different folder on the CI server:

C:\构建\ 24353 \ ......东西...... \包\ FluentValidation.5.5.0.0 \ lib目录\ Net40 \

(注意包文件夹的名字后面加.0)。

( note the extra .0 behind the package folder name ).

我不知道在哪里额外0.0从何而来。同时该项目似乎忽视了构建路径。 CI服务器有VS 2013年它,我更新的NuGet在包装盒上,并没有帮助。这里只有1处那里的5.5.0.0(含2个零),这是在参考。我删除了尾随.0解决方法还是建立在本地,而不是在CI。

I have no idea where that extra .0 comes from. Also the project seems to ignore the build path. The CI server has VS 2013 on it and I updated NuGet on the box, didn't help. There's only 1 place where there's 5.5.0.0 ( with 2 zeros ) that's in the reference. I removed the trailing .0. Solution still builds locally, but not on CI.

更新 添加第二hintpath在.csproj的文件似乎解决CI服务器上构建的,但局部破坏它。我真的不能让我的头周围为什么它是V5.0.0本地和v5.0.0.0 CI服务器上。

Update Adding a 2nd hintpath in the .csproj file seems to fix the build on CI server, but breaks it locally. I really can't get my head around why it's v5.0.0 locally and v5.0.0.0 on the CI server.

PS 我报道它的bug: https://开头github.com/NuGet/Home/issues/504

P.S. I've reported it as bug: https://github.com/NuGet/Home/issues/504

推荐答案

原来这是一个的NuGet错误,这是固定在VS2015 RC:

Turns out it was a bug in NuGet, which is fixed in the VS2015 RC:

来源: https://github.com/NuGet/Home/issues/504

这篇关于无法解析此引用:CI的NuGet服务器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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