Jduff;7760 wrote:"When working with NCrunch, you should always restore your packages inside the foreground solution instead"
Sorry for the newbie question but can you explain this please? I'm trying to work w/command line nuget and need a way to get the nuget packages restored.
Thanks.
NCrunch has two kinds of 'solutions' it works with (when you're not using distributed processing):
1. The 'foreground' solution - this is the solution that you open up in Visual Studio and make changes to. It's effectively your codebase. NCrunch will never make modifications to it but it will read any changes that are made and synchronise them into ...
2. The 'background' solutions / workspaces. These are virtual projects/solutions that are constructed inside a separate working area of your hard disk. NCrunch modifies these routinely to create transient copies of your source code. When NCrunch builds your projects and runs tests, it will do so here.
Because the 'foreground' solution is the source of all data for NCrunch, it's reliant on this solution to contain everything it needs to build your projects. In earlier versions of the product, NCrunch had no knowledge of Nuget and did not attempt to override any build steps. This meant that when NCrunch loaded up a foreground solution without the Nuget dependencies restored, Nuget would then attempt to restore its packages inside the background workspaces, which was very slow and inefficient. To prevent this from happening, NCrunch will now suppress the automatic package restore of Nuget inside background workspaces.
This means that for NCrunch to work, it needs to have all the Nuget dependencies restored inside your foreground solution. Otherwise, it will complain about missing dependencies and it won't be able to build your projects. The rule of thumb here is that if your foreground solution can build inside Visual Studio (without NCrunch involved), then you're OK here, as all the dependencies will have already been restored. If your foreground solution won't build in Visual Studio and Nuget is giving you errors, then NCrunch won't have any way to solve this for you with its own background processing.