简体   繁体   English

在AppHarbor上还原Restore Nuget软件包时生成错误

[英]Build error on Restore Nuget packages on AppHarbor

I am pushing a small MVC app to AppHarbor, which has Package Restore enabled. 我正在将一个小型MVC应用程序推送到已启用Package Restore的AppHarbor。

It builds fine on my local machine, but fails when building it after pulling it from github. 它可以在我的本地计算机上很好地构建,但是在从github上将其提取后构建时失败。

These are the relevant parts from the log: 这些是日志中的相关部分:

 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

Searching for this on google, brought me to support sites from AH, which indicate the error should be solved in the newest version of NuGet, but it isn't and I still don't know how to manually address this. 在google上搜索此内容,使我从AH获得支持站点,这表明该错误应在最新版本的NuGet中解决,但不是,并且我仍然不知道如何手动解决此问题。

What do I have to do here, to get to the core of the problem? 为了解决问题的核心,我该怎么办?

After an answer from the AppHarbor support staff, I was able to understand and solve the problem. 在AppHarbor支持人员回答后,我能够理解并解决问题。

There werre 2 things playing together to create the build error. 有werre 2件东西一起产生了构建错误。 The first was, that restore Nuget packages on build was activated in visual studio. 首先是在Visual Studio中激活了在构建时还原的Nuget软件包。 Rune from AppHarbor wrote, the new implementation should go into production next week (Nov 18-24) and will most likely eliminate those kind of build errors. 来自AppHarbor的Rune写道,新的实现应在下周(11月18日至24日)投入生产,并且很可能会消除此类构建错误。

The second reason for the build process to actually fail in AH was, that GitTools for VS do ignore the packages folder, when you commit changes and therefor the Microsoft.Mcl.Build packages which causes the error. 导致构建过程实际上在AH中失败的第二个原因是,当您提交更改并因此导致错误的Microsoft.Mcl.Build软件包时,GitTools for VS确实忽略了packages文件夹。

To solve this, either manually add this via bash 为了解决这个问题,可以通过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"

or just use the git client for windows and open your local repository. 或仅将git客户端用于Windows并打开本地存储库。 It will automatically propose to commit the whole packages folder. 它将自动建议提交整个程序包文件夹。

Commit, Sync, done. 提交,同步,完成。 Your build should now compile. 您的构建现在应该可以编译了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM