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

Notification

Icon
Error

1 solution ncrunch treating 2 projects differently
ChloeT
#1 Posted : Monday, April 10, 2017 8:43:04 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/10/2017(UTC)
Posts: 9
Location: United Kingdom

In one solution I have to 2 projects.

NCrunch notices code changes in one project (S) and reruns the tests as it should.

In another project (M) I have to rebuild the project for NCrunch to notice any changes in code.

I have not been able to find a setting which differs between these 2 projects in NCrunch.

Anyone got any idea what's going on?
Remco
#2 Posted : Monday, April 10, 2017 11:40:10 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)
Hi, thanks for sharing this issue.

Can you share any more details about these projects? Particularly, any structural differences between them? Are they both test projects? Are you using shared projects at all?

Also, when you say that you need to rebuild the project, do you mean rebuild the project in Visual Studio? If so, has NCrunch given you any warnings in the Tests Window about assembly references?
ChloeT
#3 Posted : Monday, April 10, 2017 12:53:43 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/10/2017(UTC)
Posts: 9
Location: United Kingdom

This is all in VS2013
Project S is a class library in c#
Project M is an asp.net in vb which uses S.
The NCrunch tests are in a project called units tests.
Tests on code in S work fine.
I write a test in unit tests on code in S, it fails, I edit code in S, the test reruns and the test should go green.
I write a test in unit tests on code in M, it fails, I edit the code in M, then nothing.
(The tests on project S continue to behave as expected, no warnings or extra info that I can see)
I have to rebuild project M and only then will the tests on it react to the changes I've made in it.

Remco
#4 Posted : Monday, April 10, 2017 8:54:47 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)
When you say you need to rebuild project M, do you mean rebuilding in the IDE, or reloading using NCrunch?

Has NCrunch given you any warnings about your assembly references? (try clicking on the 'Show all hidden warnings' button in the tests window to be sure).
ChloeT
#5 Posted : Tuesday, April 11, 2017 7:20:15 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/10/2017(UTC)
Posts: 9
Location: United Kingdom

Show all hidden reveals 1 message, but to a different unrelated project.
By rebuild I mean in VS I select Project M, right click it and select Rebuild in the context menu.
I've got a small screen shot of the relevant menu etc, but can't work out how to include it in the reply.

Remco
#6 Posted : Tuesday, April 11, 2017 10:02:08 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)
ChloeT;10229 wrote:

By rebuild I mean in VS I select Project M, right click it and select Rebuild in the context menu.


Ok, this is a critical piece of information. When a solution is wired together correctly, NCrunch has no dependency on your foreground (VS) build.

Can you examine how your projects are connected inside their project XML? Normally this should be using a <ProjectReference> tag. If this isn't the case, you may need to remove and re-add the reference in Visual Studio.
ChloeT
#7 Posted : Tuesday, April 11, 2017 10:21:03 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/10/2017(UTC)
Posts: 9
Location: United Kingdom

I've checked the projects XML.
The project containing the tests XML file contains these.
For Project S
<ProjectReference Include="..\Diligencia.Service\Diligencia.Service.csproj">
<Project>{4be1636a-b2ef-4032-97da-e22518aa1eec}</Project>
<Name>Diligencia.Service</Name>
</ProjectReference>
For Project M
<ProjectReference Include="..\Websites\Diligencia.MENALynx\Diligencia.MENALynx.vbproj">
<Project>{5b428e6b-63b0-4ec4-bdee-02b7feecd0e1}</Project>
<Name>Diligencia.MENALynx</Name>
</ProjectReference>

I've checked with my colleagues and they are not having this problem.
ChloeT
#8 Posted : Tuesday, April 11, 2017 11:10:27 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/10/2017(UTC)
Posts: 9
Location: United Kingdom

I've also checked in the .ncrunchproject files for both projects (S & M) and they have identical contents.
Remco
#9 Posted : Tuesday, April 11, 2017 11:13:53 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)
Thanks for sharing these extra details. You mentioned that your colleagues aren't having this problem. Are they using the same solution?

Is it possible that assemblies output from either of these projects have been installed in your GAC?
ChloeT
#10 Posted : Tuesday, April 11, 2017 11:17:37 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/10/2017(UTC)
Posts: 9
Location: United Kingdom

I've also checked in the .ncrunchproject files for both projects (S & M) and they have identical contents.
ChloeT
#11 Posted : Tuesday, April 11, 2017 11:27:09 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/10/2017(UTC)
Posts: 9
Location: United Kingdom

Sorry for the double entry.
Same Solution - use Team Explorer to keep all of what we are working on synchronized.
C:\Windows\assembly\ does not contain anything containing the name of the solution, or either of the projects
Remco
#12 Posted : Tuesday, April 11, 2017 11:44:59 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)
Ok, let's see if we can find the dependency on the foreground solution. Try the following:

- Close your IDE
- Browse to your solution directory
- Delete ALL derived files in every project (i.e. the contents of \bin and \obj). Make sure no DLLs exist for any of these projects. Your solution should be as though it is a fresh checkout.
- Open the solution and enable NCrunch, avoid building the solution before NCrunch gives you results
- See what NCrunch says. My hope is that there is a complaint somewhere in your NCrunch build about a missing reference. This might point us to where/how it is referencing the files in your foreground solution.
- If the build somehow works, try making some changes to your projects to see if NCrunch is behaving normally (make sure you don't build in VS before you do this)
ChloeT
#13 Posted : Tuesday, April 11, 2017 12:43:57 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/10/2017(UTC)
Posts: 9
Location: United Kingdom

I've followed you're instructions as far as I can.
Reopened solution in VS
NCrunch builds fine, and gives me all OK.

However VS gives me 530 errors.
Most are
X is not declared. It may be inaccessible due to its protection level.
Type 'X' is not defined.
Or others of their ilk.

This happens occasionally and the usual action is to clean & rebuild the solution.
But obviously that contra to above.

I've tried closing VS & reopening it and the solution, same as above.

I'm not sure how to proceed.
ChloeT
#14 Posted : Tuesday, April 11, 2017 1:49:27 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/10/2017(UTC)
Posts: 9
Location: United Kingdom

I've been doing some testing, once I got VS happy again, and NCrunch seems to be working properly on project M.
So thanks for your help, seems forcing all the derived files to be recreated did the job.
Remco
#15 Posted : Wednesday, April 12, 2017 12:10:06 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)
I'm glad to hear this got you up and running again, although I don't think we've solved the root of this problem. You'll likely see it happen again :(

There is something not right in the dependency resolution in your solution. Somewhere in your solution you have projects depending on derived files instead of .csproj files.

NCrunch has a number of warnings that usually activate when it detects this sort of scenario. I'm not sure why you haven't seen a targeted warning about it, but I strongly recommend investigating this problem as it will likely cause problems inside and outside of NCrunch. It should always be possible to execute a 'clean build' in Visual Studio in one step without needing to run your build multiple times.
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.066 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download