NCrunch Forum
»
General Support
»
Build/Test Issues
»
Extension methods not present when debugging
Rank: Member
Groups: Registered
Joined: 12/14/2011(UTC) Posts: 11 Location: Seattle, WA
Thanks: 1 times
|
When I'm debugging a test in ncrunch, if I try to inspect a System.Linq.IQueryable and then call ToList() on it in the QuickWatch tool I get:
'System.Linq.IQueryable<MYTYPE>' does not contain a definition for 'ToList' and no extension method 'ToList' accepting a first argument of type 'System.Linq.IQueryable<MYTYPE>' could be found (are you missing a using directive or an assembly reference?)
Certainly Linq provides all of these as extension methods, and when I debug this by attaching Visual Studio to nUnit it works as expected. Is there something special I need to do for nCrunch?
|
|
|
|
Rank: NCrunch Developer
Groups: Administrators
Joined: 4/16/2011(UTC) Posts: 7,143
Thanks: 959 times Was thanked: 1290 time(s) in 1196 post(s)
|
Hi,
This is interesting. NCrunch does do some wizardry in order to build your test/debug environment inside its workspace, so I'm wondering if something here may be messing up the resolution in the debugger. Does the ToList() extension method work if you try it inside the immediate window?
|
|
|
|
Rank: Member
Groups: Registered
Joined: 5/9/2012(UTC) Posts: 13 Location: Auckland
Was thanked: 1 time(s) in 1 post(s)
|
I'm getting a similar issue too. In the immediate window, the following occurs:
> myEnumerable.ToList()
'System.Collections.Generic.IEnumerable<T>' does not contain a definition for 'ToList' and no extension method 'ToList' accepting a first argument of type 'System.Collections.Generic.IEnumerable<T>' could be found (are you missing a using directive or an assembly reference?)
I have 'using System.Linq' in the file in question.
When I reference the extension method directly as follows it works fine: > System.Linq.Enumerable.ToList(myEnumerable) Count = 1 [0]: ...
When debugging through the ReSharper Unit Test runner it generally works fine.
|
|
|
|
Rank: NCrunch Developer
Groups: Administrators
Joined: 4/16/2011(UTC) Posts: 7,143
Thanks: 959 times Was thanked: 1290 time(s) in 1196 post(s)
|
Thanks. I've since done some more looking into this issue, and I can confirm that it is caused by the way that NCrunch is handling its namespaces when processing debug information during instrumentation. The fix is very difficult but I do hope to solve this problem eventually. Generally the workaround is to specify the full namespace of anything you access in the debugger - though I've yet to find a way to make this work for extension methods.
|
|
|
|
NCrunch Forum
»
General Support
»
Build/Test Issues
»
Extension methods not present when debugging
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.NETThis page was generated in 0.036 seconds.