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

Notification

Icon
Error

After removing a failing project from the solution, it does not disappear from NCrunch
abelb
#1 Posted : Monday, September 5, 2016 10:38:47 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 9/12/2014(UTC)
Posts: 155
Location: Netherlands

Thanks: 19 times
Was thanked: 11 time(s) in 11 post(s)
The project that I removed from the *.sln file is failing its build and I don't know (and don't care) how to make it work, so I removed it from the solution as there were no dependencies anymore. But NCrunch didn't remove it.

I think I tried everything, including running the VS2015 Setup to repair Visual Studio. I used an old trick to force-reload everything (by changing the general settings of the NCrunch configuration), but this didn't help. I changed the build configuration(s) multiple times (per project, unfortunately, so a lot of work) and checked manually whether any (hidden) references to my old project still existed.

The weirdest thing: when I load this solution and start NCrunch, it says "Loading project 1 of 14" etc. But at the end it says "Loading project 15 of 14".



In the NCrunch configuration window, the project is not listed.

If I rightclick the project in NCrunch and select Ignore Selected Tests, nothing happened. I tried to find a different option to ignore a certain component completely (is there such an option?), but couldn't find it.

I have to admit, I am still on a rather old version of NCrunch (2.16). I'll first remove the cached project files of NCrunch, but I hope that when I upgrade this project would also disappear.
Remco
#2 Posted : Monday, September 5, 2016 11:57:46 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
NCrunch discovers projects in two ways:

1. From the solution itself (i.e. sln file or reported from VS)
2. By traversing project references from other projects it has loaded

When projects are discovered using '2', this will throw out NCrunch's expected project count in the initialisation counter.. So you'll see the strange 15 out of 14. As funny as this looks, it is actually by design - NCrunch expected to load 14 projects, but ended up needing to load 15 because of project dependencies.

The problem you're experiencing is likely because you still have a project in your solution that references the project you removed. NCrunch is finding this reference at load time and loading the removed project anyway.

This behaviour is the same for the current version as it is for 2.16. If you've been hit with an internal issue of some kind, clearing out the cache file will often fix it. Upgrading to the latest version of NCrunch will refresh the cache file anyway, so there is no need to delete it if you upgrade.
abelb
#3 Posted : Monday, September 5, 2016 12:15:27 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 9/12/2014(UTC)
Posts: 155
Location: Netherlands

Thanks: 19 times
Was thanked: 11 time(s) in 11 post(s)
Hi Remco,

You just beat me to it. Visual Studio wasn't showing _any_ reference to it in any of the projects (and it builds fine). But then I found the culprit, I had a line like the following in one fsproj file:

Code:
<When Condition=" $(Configuration.EndsWith('_ICU')) or '$(NCrunch)' == '1' ">
    <ProjectReference Include="..\..\Path-to-ICU-prj\Xxx.ICU.vcxproj">
    <!-- some more -->
</When>


Not sure why, at any given time in the history of this project, I added that when-condition, it should never have been there, I think.

Clearly, that line created a difference in loaded projects between Visual Studio (there are no "_ICU" configurations anymore) and NCrunch. Removing it solved the problem at once. Thanks for your fast reply. Now on to upgrading, I read you added a lot of cool features! :)
abelb
#4 Posted : Monday, September 5, 2016 12:18:23 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 9/12/2014(UTC)
Posts: 155
Location: Netherlands

Thanks: 19 times
Was thanked: 11 time(s) in 11 post(s)
Interestingly, it shows a small bug of NCrunch (which may or may not be present in the current release). If you have a reference like the one shown above, with the $(NCrunch) variable, it is odd that the same reference is not shown in the NCrunch Configuration window. Apparently, the NCrunch Tests window and the NCrunch Configuration window use different heuristics to find the project references.
Remco
#5 Posted : Monday, September 5, 2016 12:29:17 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
abelb;9151 wrote:
Interestingly, it shows a small bug of NCrunch (which may or may not be present in the current release). If you have a reference like the one shown above, with the $(NCrunch) variable, it is odd that the same reference is not shown in the NCrunch Configuration window. Apparently, the NCrunch Tests window and the NCrunch Configuration window use different heuristics to find the project references.


Interesting. Are you saying that the project is not shown in the configuration window, but it IS shown in the Tests Window? I think there may be a known problem related to this.
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.036 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download