I'm trying to use the new v3 'Project config file storage path' feature to save NCrunch configuration to a folder outside of the source directory. I've set the appropriate configuration and have checked the .v3.ncrunchsolution file and confirmed the ProjectConfigStoragePathRelativeToSolutionDir element is set appropriately. My changes are still being saved to the .v3.ncrunchproject files in source folder beside the project however.
My expectation is that the .v3.ncrunchproject files are moved/saved to the new path I specify but that doesn't appear to be happening. Is there a trick to getting this feature to work or am I misunderstanding how it's supposed to work?
I'm using Visual Studio 2015 on Windows 10. My configuration path is absolute and is on a different drive to the source e.g. C:\Source\MyProject.csproj with configuration in D:\Configuration\NCrunch\Blah.
EDIT: Further to this, it looks like the configuration user interface is getting confused about what configuration it's using. I have multiple branches that contain the same solution and structure e.g. a master branch and a release/tag branch; the configuration user interface appears to be showing me the configuration for my solution in the master branch even when the release/tag branch solution is open in Visual Studio (it's as if NCrunch is caching the configuration of the solution I opened first (master) and not invalidating it when I open the release/tag branch). This only appears to affect the user interface though; the underlying Engine appears to be using the correct configuration (I have a number of project exclusions and additional files configured in master - when I open the release/tag solution (where I don't have the same configuration), the UI shows me the master configuration but the NCrunch engine fails to build the solution).
Thanks for sharing these issues. This is quite a complex configuration setting in regards to solution switching, so I guess it isn't a huge surprise that something found a way to go wrong here.
If I understand what you've described, it feels like there are two problems here:
- When changing the setting, it didn't appear to take effect immediately and it didn't move the configuration files
- When switching solutions, the UI is using settings from the previously open solution
I'm wondering if we could delve a bit deeper on these two issues so that I can reproduce them in order to fix them. Have I understood these problems correctly? Are you able to give me any clear steps to reproduce either of these on a dummy solution? I'm hoping that we aren't dealing with any erratic race conditions here.
Yes, I guess it is two separate issues. Your description of both issues is accurate (let me know if you want me to split them into separate posts).
Regarding the solution switching configuration UI issue, I managed to reproduce this quite easily:
* I created a new Class Library project in C:\A\ClassLibrary1.csproj and added NUnit via Nuget and an empty test fixture and test method
* I configured the project with 'Additional files to include' and just pointed it at my Nuget package.config
* Everything built and NCrunch detected the test and executed it.
* I copied the .sln, .csproj, .cs, .config and Properties folder to C:\B (no NCrunch files were copied)
* I closed ClassLibrary1.csproj from C:\A and opened the identical one from C:\B
* I enabled NCrunch and when I went to configure it, my additional file was already there in the configuration UI (the UI shows it despite the relevant configuration not being present in the .v3.ncrunchproject).
Regarding the 'Project config file storage page'. It doesn't seem to matter what I set it to, nothing ever gets written to the path. The files always get written beside the project files.
Thanks for these extra details! I've managed to reproduce the 'Project config file storage path' issue. It looks like this doesn't support absolute file paths like it's supposed to. I'll have a fix for this available soon.
I'm also investigating the other issue and will update you soon.
I've managed to reproduce the UI settings issue. It looks like this issue has quite a narrow scope - you did well finding it.
Basically, the UI isn't clearing out the stored settings for projects when the solution is closed. This causes the settings to transfer over to the new solution, which in this case happens to have projects of the same name under the same relative path as the last solution. Because there are no settings for these projects in the new solution, they just inherit the ones already present in the UI.
I'm expecting to have a fix out for both of these issues in 3.1. I'd prefer to hold this release for a day or so just to make sure nothing else needs to be included in the build. Everything tends to go a bit crazy around big releases and I'm sure people will find other problems.