Build Consistently fails due to NuGet error

Joe's Avatar

Joe

05 Aug, 2013 02:17 PM

I know this is a common problem, a quick google shows this, however all the problems appear in 2012.

I am having a similar problem, my build consistently fails 4-5 times with the dreaded "The process cannot access the file", then after multiple "pokes" it will work.

Build FAILED.

       "D:\temp\ym31vsxs.asv\input\Source\AppHarbor.sln" (default target) (1) ->
       "D:\temp\ym31vsxs.asv\input\Source\MessageHub.Server\MessageHub.Server.csproj" (default target) (7) ->
       (RestorePackages target) ->
         D:\temp\ym31vsxs.asv\input\Source\.nuget\NuGet.targets(87,9): error : The process cannot access the file 'C:\Users\apphb33bb4c2d0b4245\AppData\Local\NuGet\Cache\Common.Mapping.3.8.nupkg' because it is being used by another process. [D:\temp\ym31vsxs.asv\input\Source\MessageHub.Server\MessageHub.Server.csproj]
         D:\temp\ym31vsxs.asv\input\Source\.nuget\NuGet.targets(87,9): error MSB3073: The command ""D:\temp\ym31vsxs.asv\input\Source\.nuget\NuGet.exe" install "D:\temp\ym31vsxs.asv\input\Source\MessageHub.Server\packages.config" -source "https://nuget.org/api/v2/;http://www.mtmbuildserver.com/guestAuth/app/nuget/v1/FeedService.svc/" -NonInteractive -RequireConsent -solutionDir "D:\temp\ym31vsxs.asv\input\Source\ " " exited with code 1. [D:\temp\ym31vsxs.asv\input\Source\MessageHub.Server\MessageHub.Server.csproj]

    0 Warning(s)
    2 Error(s)

All the solutions say to upgrade to v2 of NuGet, and I am running 2.6 in my repo.

I don't have multiple branches that AppHarbor is watching, but I do have a web and background worker. Could that be the problem?

EDIT:
I forgot to mention that the package in question. Common.Mapping is used by both the web and background worker.

  1. Support Staff 1 Posted by rune on 05 Aug, 2013 04:28 PM

    rune's Avatar

    Hi Joe,

    I'd be a bit surprised if referencing the same file from multiple projects would cause the error since each project should be built indenpendently without affecting each other. However it's not entirely unlikely and we'll make sure to investigate if that is maybe the reason.

    I'm wondering if disabling the NuGet cache would solve this problem - disabling the cache has worked for other NuGet related problems and may very well be a solution in this case as well. You can see my answer in this thread for an example of how to do that.

    Best,
    Rune

  2. 2 Posted by Joe on 06 Aug, 2013 01:56 PM

    Joe's Avatar

    The link you included is private so I cannot access it, however I think I may have got it working by disabling the cache as such:

    <RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " -nocache </RestoreCommand>

    So far, the builds are succeeding, but more builds will need to happen before I think I can call it fixed.

  3. Joe closed this discussion on 06 Aug, 2013 01:56 PM.

  4. rune re-opened this discussion on 06 Aug, 2013 02:11 PM

  5. Support Staff 3 Posted by rune on 06 Aug, 2013 02:11 PM

    rune's Avatar

    Alright got it - thanks for getting back to me with the results. On a related note the new version of NuGet due next month will be incorporated into AppHarbor's build infrastructure and will likely solve these issues going forward.

    Best,
    Rune

  6. Joe closed this discussion on 07 Aug, 2013 02:18 PM.

Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac