سؤال

I am pushing a small MVC app to AppHarbor, which has Package Restore enabled.

It builds fine on my local machine, but fails when building it after pulling it from 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.

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.

There werre 2 things playing together to create the build error. The first was, that restore Nuget packages on build was activated in visual studio. 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.

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.

To solve this, either manually add this via 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. It will automatically propose to commit the whole packages folder.

Commit, Sync, done. Your build should now compile.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top