【发布时间】:2011-12-13 00:16:53
【问题描述】:
我已经在团队城市建立了一个构建,在测试项目中有一个 NuGet 包引用。
我使用的文件夹结构是
\
|- Project1
\- Project1.csproj
|- Project1.Test
\- Project1.Test.csproj
|- packages
\- lib
\- RhinoMocks
Project1 项目成功构建,但 Test 项目在 ResolveAssemblyReferences 步骤中失败。相对路径似乎不正确。
[13:16:55]: [ResolveAssemblyReference] C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360, 9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Rhino.Mocks, Version=3.6.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
[13:16:55]: [ResolveAssemblyReference] For SearchPath "{HintPathFromItem}".
[13:16:55]: [ResolveAssemblyReference] Considered "..\packages\RhinoMocks.3.6\lib\Rhino.Mocks.dll", but it didn't exist.
TeamCity 构建配置:
- MSBuild 任务
- 构建文件路径:Project1.Test\Project.Test.csproj
- 工作目录:%system.teamcity.build.checkoutDir%\Project1.Test
- VCS root 指向上述文件夹结构的根目录。
据我所知,这可能是一个 MSBuild 问题,当我在构建代理的结帐文件夹中的命令行中运行 MSBuild 时,我遇到了同样的错误。
更多信息: 提示路径由 Nuget 包配置提供。在 Visual Studio 中,包引用可以正常工作。但是,当通过 MSBuild 运行时,它似乎对其当前目录感到困惑。 ..\packages... 路径实际上是 Nuget 的逐字引用路径。
【问题讨论】:
标签: msbuild continuous-integration teamcity nuget