Question

Recently, I changed the output path of my project (a class library) from the default (../bin/debug) to:

$(OURDIRECTORY_BUILD)\Debug\ where OURDIRECTORY is an environmental (System) variable).

I also changed the UnitTest project (that was in the same solution) to reference the class library like this:

Reference Include="MyLibrary"> $(OURDIRECTORY )\Debug\MyLibrary.dll

Previously, I had just referenced it as a project reference. I made the change from project reference to the above as I was having build problems once I changed the Output Path.

Anyhow, now all is building and the unit tests are all passing BUT when I look at the NCrunch metrics, they are all at 0.00% AND the code coverage markers are all white (no coverage). Obviously, I do have coverage (very close to 100%) and something about changing the output path has confused NCRUNCH. How should I be handling this?

I am somewhat constrained to use this idea of a environmental variable for the output path as my boss is suggesting it. We have multiple libraries being built (not all in same solution) and are trying to make everything build-able on multiple machines. This scheme lets each engineer pick his own path for the environmental variable and even have a couple of code bases that he can switch between by changing the environment variable value.

Let me know if I can provide more details or if there is a more appropriate place to post.

Thanks,

Dave

Was it helpful?

Solution

I got no comments/answers here, perhaps this question was too product specific for StacKOverflow. My apologies. After I posted here, I came across a dedicated NCrunch forum site and posted there. I got some useful info. So for those of you looking deparately looking for an answer (as I was) I refer you to:

http://forum.ncrunch.net/yaf_postsm5457_NCRUNCH-code-coverage-markers-are-all-white-after-changing-output-path-of-project-under-test.aspx#post5457

If that link doesn't work in the distant future, search for the title, "NCRUNCH code coverage markers are all white after changing output path of project under test", and if that doesn't work, the brief (and most important part of) answer is to use two paths like so:

<OutputPath Condition="'$(NCrunch)' == '1'">bin\</OutputPath>
<OutputPath Condition="'$(NCrunch)' != '1'">$(OUTDIRECTORY)</OutputPath>

This worked for me.

Dave

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top