Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NCrunch fails to build solutions using Automatic Package Restore
distilled
#1 Posted : Thursday, April 10, 2014 12:57:23 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/3/2012(UTC)
Posts: 22

Thanks: 2 times
Was thanked: 6 time(s) in 6 post(s)
NuGet 2.7 included a new Automatic Package Restore feature to replace the package restore process that depends on MSBuild integration. A comparison of how the two approaches differ is summarized here. After migrating a solution to the new automatic package restore, NCrunch was no longer to build my projects because it could no longer locate the binaries in my NuGet packages.

I attempted to set "Copy referenced assemblies to workspace" to true, and even instructed NCrunch to copy the entire packages folder to my workspace, without success.

Reverting my projects to use the MSBuild-integrated package restore fixed the issue.
Remco
#2 Posted : Thursday, April 10, 2014 9:35:55 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,986

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for sharing this issue.

Since V1, NCrunch has deliberately disabled Nuget package restore for its own builds. Because Nuget was previously performing this via a custom build target, the approach taken here was simply to remove the build target. This was done because the auto package restore was kicking in for each individual workspace, causing the references to be downloaded again and again, which is very inefficient. This means that you would need to perform a Visual Studio build against a solution before you could run NCrunch on it, to make sure that all the packages were restored before NCrunch would begin processing.

If I understand the new package restore method correctly, the same situation applies. NCrunch won't restore the packages automatically so it is dependent on you performing a manual build in Visual Studio first. One point of difference that may now exist is around NCrunch's synchronisation with these references. Previously, Nuget was probably touching the project file triggering NCrunch to reload projects after the references were restored. It's likely that this is no longer the case, so you'll need to reset the NCrunch engine after the packages have been restored. This will cause the engine to resync and detect the newly restored references.

Does this match your experience with package restore?
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.027 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download