Build/Test Issues

Project References lost in Ncrunch Generated Project File

Started by Adamm on 8,566 views

I can email in the Project files.
But since we upgraded to 2.4.0.2
a number of projects fail to build.

The reason is that the NCrunch generated csproj file is missing a reference.

The original csproj references a project called Core (Project Reference)
The ncrunch project file does not?


This is happening for all test projects that reference this core project.
Other non test projects build successfully.
It turns out the failing projects are duplicated in NCrunch.
One is succeeding and one is failing.

I think NCrunch may be barfing due to this.
In our solution file we have duplicate names (VS allows it)


Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "Core\Code\Core\Core.csproj", "{B42A20F2-74CA-4702-9721-252396FE44C5}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "Infrastructure\Core\Core.csproj", "{D3454A30-3418-45B8-8CD5-95D1B6731DBF}"

I didn't name them :)

Edited

Hi, thanks for sharing this issue.

NCrunch should normally be using the project file paths to differentiate between projects, rather than their names.. for exactly the reason that the names may not be unique :)

So this is a bit of a mystery to me. You must have managed to find a hole in the logic somewhere.

Now, the tough part is that I probably won't have much luck being able to isolate this problem with just a bug report or the project files involved. I'd need to follow through every step of the analysis, workspacing and build process to find out where it's going wrong.

This means that I can solve the problem for you (and actually, would very much like to), but I'll need a code sample that can fully reproduce it. I realise that creating code samples like this takes valuable time so I will understand if you find it easier to simply rename the project to get NCrunch to work. Probably I would recommend renaming it anyway, just because it's very confusing to have two projects under the same name :)


Cheers,

Remco
Example on its way
Thanks for the code sample!

I had a good look at this one ... tore it to pieces, couldn't figure out why it wasn't working even though it was almost identical to several test cases I have for the same situation.

Then I noticed that the second 'Core' project has the 'Ignore this project completely' setting put as 'True'. I guess it all makes sense in the end :)

Something I thought I'd also check with you is whether you regularly work with the 'Include static references in workspace' turned off. Unless this is correcting a compatibility issue with your project, I'd recommend leaving this setting on. Turning it off can result in file locking issues during source control operations etc.
If only you didnt need users! :)
Ncrunch 2 : Adam 0

Thanks for the quick response.
I think the static reference settings was just me randomly trying settings.
Tend not to touch config, except to ignore certain projects. (Like core!)
I think you did manage to highlight a serious usability issue though :)

This is not the first time a support request has been raised because of the 'Ignore this project completely' flag. It tends to create obscure build errors. I've also noticed that the configuration window wasn't showing the project as greyed out the way it should be.

So there's some good that's come from this:

- I've fixed the configuration window so it's more obvious now when projects are ignored
- I've added a warning to the project loader so it will let you know if other projects are referencing ignored projects

Hopefully we'll be the last people caught out by this!


Cheers,

Remco

Post a reply

Log in to reply.