0

我正在将一个小型 MVC 应用程序推送到 AppHarbor,它启用了包还原。

它在我的本地机器上构建良好,但在从 github 拉出后构建它时失败。

这些是日志中的相关部分:

 2>D:\temp\0gqraufl.b33\input\ISC-Devicemanagement\ISC-Devicemanagement.csproj(364,5): error : The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568.
     2>Done Building Project "D:\temp\0gqraufl.b33\input\ISC-Devicemanagement\ISC-Devicemanagement.csproj" (default targets) -- FAILED.
     1>Done Building Project "D:\temp\0gqraufl.b33\input\ISC-Devicemanagement.sln" (default targets) -- FAILED.

Build FAILED.

       "D:\temp\0gqraufl.b33\input\ISC-Devicemanagement.sln" (default target) (1) ->
       "D:\temp\0gqraufl.b33\input\ISC-Devicemanagement\ISC-Devicemanagement.csproj" (default target) (2) ->
       (EnsureBclBuildImported target) -> 
         D:\temp\0gqraufl.b33\input\ISC-Devicemanagement\ISC-Devicemanagement.csproj(364,5): error : The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:14.97

在谷歌上搜索这个,把我带到了 AH 的支持网站,这表明错误应该在最新版本的 NuGet 中解决,但事实并非如此,我仍然不知道如何手动解决这个问题。

我必须在这里做什么才能找到问题的核心?

4

1 回答 1

0

在得到 AppHarbor 支持人员的回答后,我能够理解并解决问题。

有 2 件事情一起发生导致构建错误。第一个是,在 Visual Studio 中激活了构建时恢复 Nuget 包。来自 AppHarbor 的 Rune 写道,新的实现应该在下周(11 月 18 日至 24 日)投入生产,并且很可能会消除这些构建错误。

AH 中构建过程实际失败的第二个原因是,当您提交更改以及Microsoft.Mcl.Build导致错误的包时,VS 的 GitTools 会忽略包文件夹。

要解决此问题,请通过 bash 手动添加

//enter the version which is referenced in your solution
git add packages/Microsoft.Bcl.Build.1.0.10/ -f 
git commit -m "Add Microsoft.Bcl.Build NuGet package"

或者只是使用 Windows 的 git 客户端并打开您的本地存储库。它会自动建议提交整个包文件夹。

提交,同步,完成。您的构建现在应该可以编译了。

于 2013-11-16T08:41:23.440 回答