Daily Usage Issues

Dlls for nuget packages copied to solution root

Started by mworley on 5,880 views

Hi, I'm finding that there's a strange interaction between NuGet and NCrunch.

Steps to reproduce.

1. Create a new solution and add project (the type doesn't matter, so say a console application).
2. Add a NuGet package to the project (again, it doesn't matter so long as it's a DLL, so say Json.NET).
3. Enable NCrunch (I'm not sure if the settings affect this issue, but I selected No Parallel, Automatic Execution, Let my tests run).
4. Close, then reopen the solution.
5. Tools > Library Package Manager > Manage Nuget Packages For Solution > Installed Packages.
6. The files Newtonsoft.Json.dll and Newtonsoft.Json.xml will have been copied to the solution root folder.

This is in VS2012, using NCrunch 1.46 (I also rolled back and tested with 1.45), NuGet Package Manager 2.6, Windows 8.

I have tested this repeatedly in numerous new, clean solutions and have been able to reproduce consistently.

In the example, a couple of files are no real issue. However, in large solutions the number of files copied to the root become disruptive and cause problems with source control. Steps 4 and 5 are part of daily workflow. Interacting with NuGet via the console while NCrunch is running seems to have the same effect.

Thanks.
Hi, thanks for reporting this issue.

I haven't been able to reproduce the exact problem you've described above, but looking into what is happening here, I think I can construct a fairly concrete theory on what is happening.

It seems that when the Nuget package manager is accessed, it touches the projects within the solution and triggers some kind of build logic to activate. Because the projects are marked as changed by Visual Studio, NCrunch reloads them and attempts to build them. This creates a situation where the Nuget build and NCrunch build overlap. The overlap creates all sorts of interesting race conditions that can skew build logic and cause files to be copied randomly to the wrong places.

A fix for this will be included in the next version of NCrunch.

For the time being, I recommend disabling NCrunch before accessing the Nuget package manager - as this will prevent the builds from overlapping.


Cheers,

Remco
Hi Remco

Thank you very much for this - great news and excellent support!

Disabling NCrunch when working with NuGet will be no problem at all in the short term.

Cheers

Post a reply

Log in to reply.