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

Notification

Icon
Error

Missing method exception
MattK
#1 Posted : Wednesday, February 12, 2014 4:31:25 PM(UTC)
Rank: Member

Groups: Registered
Joined: 10/8/2013(UTC)
Posts: 11
Location: United Kingdom

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
Myself an a colleague of mine have both had an issue with tests giving a "missing method exception" after some refactoring. I saw it when i moved a method from an abstract class to a concrete class that inherited from the abstract class.
We are running ncrunch 2.4.0.2 on visual studio 2013.
I resolved the issue on my machine by disabling and then enabling ncrunch (forcing ncrunch to do a fresh build?). My colleague solved his by restarting his visual studio.
Remco
#2 Posted : Wednesday, February 12, 2014 10:57:29 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,986

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for sharing this issue.

The cause of this is when NCrunch doesn't realise that a particular change you have made requires a depending project to be rebuilt. In theory, moving a method between types shouldn't be able to do this. Is it something you're able to reproduce? Was it done using an automated refactoring?

Cheers,

Remco
MattK
#3 Posted : Thursday, February 13, 2014 9:11:43 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/8/2013(UTC)
Posts: 11
Location: United Kingdom

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
Hi Remco. I think i did the refactoring manually, and it also involved moving the same method from 1 interface to another. I do have ReSharper 8 installed so it's possible i used that but in this case i don't think i did. The classes i moved the method between were in project A, the method only calls 1 other method on an interface in project B, and the tests were in project C if that helps.
When it happens again i will hopefully be able to give more details. Is there anyway i can get you more information if it does?

Cheers,

Matt
MattK
#4 Posted : Thursday, February 13, 2014 9:15:28 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/8/2013(UTC)
Posts: 11
Location: United Kingdom

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
Also, the code in the tests didn't change as the test was calling a concrete class and the method i moved was from the abstract class it was inheriting from.
Remco
#5 Posted : Thursday, February 13, 2014 10:50:16 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,986

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Thanks Matt. I've just done some experimentation but couldn't get this to happen for me. If you can manage to reproduce it consistently, do let me know how :)

Cheers,

Remco
MattK
#6 Posted : Tuesday, March 11, 2014 11:57:06 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/8/2013(UTC)
Posts: 11
Location: United Kingdom

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

I posted the above a month ago. I haven't been able to reproduce it since then but i have had a similar issue today.
I was moving some files around in project A, placing them in new folders and changing the namespace. The test project that relates to them cannot build, i think because it is seeing the old namespaces. I get lots of errors like this:

ConnectionTests\ListeningHigherCarpConnectionTests.cs (23): The type or namespace name 'ConnectResponseStatus' could not be found (are you missing a using directive or an assembly reference?)

If i go into each of the files that has a problem and put in some whitespace, ncrunch detects a change to the file and the error stops showing.

It should be noted i was using resharper to change the namespaces on my classes. I am using version 2.5.0.12 of ncrunch.

Cheers,

Matt
Remco
#7 Posted : Tuesday, March 11, 2014 12:04:10 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,986

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Thanks Matt. I do think that this is a different side of the same problem.

My theory at the moment is that there is some kind of data race involved when doing certain refactoring actions. 99% of the time, everything is fine and nothing goes wrong.. but on occasion, the data is being represented to NCrunch in an incomplete state.

It's extremely difficult to track and resolve an issue such as this, as it's likely to be occurring beneath the synchronisation layer (i.e. in VS itself), and the inconsistency stops it from being pinned down.

There may be changes to the way NCrunch synchronises with code in future.. for now, if you see this happen, I recommend just going in and touching the source file that seems to be out of sync with the rest of the codebase. This will trigger the event that will make NCrunch refresh its knowledge of the file, and is a much faster way to solve the problem than a full engine reset.
1 user thanked Remco for this useful post.
MattK on 3/11/2014(UTC)
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.046 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download