【发布时间】:2014-02-07 05:32:16
【问题描述】:
从 bitbucket 部署到 AppHarbor 时出现构建错误。它与无法解决应该来自 Nuget 的依赖项的项目之一有关。一切都在我的机器上构建并运行良好。知识 - 我非常精通 Nuget 和经验丰富的开发人员。我可能是通过在本地改组文件夹并重新创建 bitbucket repo 造成的。我检查了 bitbucket 源,与本地相比,似乎一切都在那里。
我的解决方案的结构类似于:
\repo\app.sln
\repo\model\model.csproj
\repo\web\web.csproj
model 是一个核心/模型类库项目。 web 是一个依赖于模型的网络应用程序(webapi2 + html)。两者都可以正确构建并且在我的本地机器上运行良好,但我最近遇到了 Bitbucket 的一些问题,所以我在磁盘上移动了一些东西并创建了一个新的存储库。只有当它被运送到 Appharbor 时,它才会破坏构建。
两个项目都启用了 Nuget 包恢复功能。
这是 AppHarbor 构建过程的日志顶部:
Build started 2/7/2014 5:19:58 AM.
1>Project "D:\temp\g0q2xqui.baf\input\app.sln" on node 1 (default targets).
1>ValidateSolutionConfiguration:
Building solution configuration "Release|Any CPU".
1>Project "D:\temp\g0q2xqui.baf\input\app.sln" (1) is building "D:\temp\g0q2xqui.baf\input\web\web.csproj" (2) on node 1 (default targets).
2>RestorePackages:
"D:\temp\g0q2xqui.baf\input\.nuget\NuGet.exe" install "packages.config" -source "" -NonInteractive -RequireConsent -solutionDir "D:\temp\g0q2xqui.baf\input\ "
1>Project "D:\temp\g0q2xqui.baf\input\app.sln" (1) is building "D:\temp\g0q2xqui.baf\input\model\model.csproj" (4) on node 2 (default targets).
4>RestorePackages:
"D:\temp\g0q2xqui.baf\input\.nuget\NuGet.exe" install "packages.config" -source "" -NonInteractive -RequireConsent -solutionDir "D:\temp\g0q2xqui.baf\input\ "
2>RestorePackages:
Restoring NuGet packages...
To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
All packages listed in packages.config are already installed.
4>RestorePackages:
Restoring NuGet packages...
To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
All packages listed in packages.config are already installed.
ResolveAssemblyReferences:
Primary reference "MongoDB.Bson".
4>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "MongoDB.Bson". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\temp\g0q2xqui.baf\input\model\model.csproj]
For SearchPath "{HintPathFromItem}".
如您所见,“模型”(#4)项目无法解析 MongoRepository nuget 包的引用。这会级联并破坏构建。
这是模型项目的 packages.config:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="mongocsharpdriver" version="1.8.3" targetFramework="net45" />
<package id="MongoRepository" version="1.6.3" targetFramework="net45" />
</packages>
【问题讨论】:
标签: visual-studio-2012 nuget bitbucket appharbor