Hi,
I just noticed that NCrunch now responds to 'Unload Project' in Visual Studio (16.9.2) and also unloads components.
This would be quite helpful, especially when refactoring large solutions, that temporarily result in partially uncompilable projects.
The extension https://marketplace.visualstudio.com/items?itemName=reduckted.ProjectFilter makes loading and unloading projects quite easy.
A problem occurs, when the solution is stored and reopened, VS does not load the previously unloaded projects, while NCrunch reloads all components (including the previously unloaded components). Is there any way to fix this?
Regards
Wilhelm
Remco NCrunch Developer
#15373
24 Mar 2021 23:12 UTC
Hi Wilhelm,
Thanks for posting.
The unloading of projects in VS isn't a feature that we can properly support, because we need to have all projects in the dependency tree loaded to be able to construct a runtime environment. NCrunch can't produce results if a critical project is unloaded, which unfortunately negates the value of any such feature.
Presently, it is possible to make NCrunch temporarily unload a project if this project sits at the top of the dependency tree (i.e. a test project). As you've discovered, this is done by telling VS to unload the project after everything is initialised.
As you've also described, when the IDE is reloaded with the project still in its unloaded state, NCrunch will just load the project anyway regardless ... so the status isn't remembered across the reload. The reason for this has to do with the way the project system works inside VS. Currently, we don't have a way to reliably tell the difference between a project that is locked in an unloaded state and a project that simply hasn't been loaded yet by the IDE. It's possible that some way to do this exists, but it would require time and research, and maybe nasty integration hacks. Given that we can't support the feature for anything other than top level projects anyway, this does not seem worth pursuing. I would suggest just using the 'Ignore this component completely' setting instead.
Thanks for posting.
The unloading of projects in VS isn't a feature that we can properly support, because we need to have all projects in the dependency tree loaded to be able to construct a runtime environment. NCrunch can't produce results if a critical project is unloaded, which unfortunately negates the value of any such feature.
Presently, it is possible to make NCrunch temporarily unload a project if this project sits at the top of the dependency tree (i.e. a test project). As you've discovered, this is done by telling VS to unload the project after everything is initialised.
As you've also described, when the IDE is reloaded with the project still in its unloaded state, NCrunch will just load the project anyway regardless ... so the status isn't remembered across the reload. The reason for this has to do with the way the project system works inside VS. Currently, we don't have a way to reliably tell the difference between a project that is locked in an unloaded state and a project that simply hasn't been loaded yet by the IDE. It's possible that some way to do this exists, but it would require time and research, and maybe nasty integration hacks. Given that we can't support the feature for anything other than top level projects anyway, this does not seem worth pursuing. I would suggest just using the 'Ignore this component completely' setting instead.
Hi Remco,
thanks for the explanation.
thanks for the explanation.
Post a reply
Log in to reply.