Hello again,
I followed your suggestion and I think I've isolated the problem. After breaking into the code and looking at the loaded modules, everything seemed fine. The correct version of ApprovalUtilities was loaded. Poking around in the debugger, I tried executing the bad line of code in the quick watch window, and later in the immediate window. In the immediate window I got this:
Quote:ApprovalUtilities.Asp.Mvc.MvcUtilites.Explicit(View(repository.GetCars()))
The best overloaded method match for 'ApprovalUtilities.Asp.Mvc.MvcUtilites.Explicit(System.Web.Mvc.ViewResult)' has some invalid arguments
ApprovalUtilities.Asp.Mvc.MvcUtilites.Explicit(new ViewResult())
The type or namespace name 'ViewResult' is not valid in this scope
So I went back to the module list and found this:
Quote:
System.Web.Mvc.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Mvc\v4.0_3.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll
System.Web.Mvc.dll C:\Windows\assembly\GAC_MSIL\System.Web.Mvc\2.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll
Since two versions of MVC are loaded, the runtime appears to be having trouble deciding what a ViewResult is, and can't decide whether it can use the extension method in ApprovalUtilities. I debugged the same test under the VS test runner and sure enough, only MVC v3 was loaded. I uninstalled MVC v2 from one of my machines, and sure enough, the test works in NCrunch now. You could probably reproduce on your side by grabbing MVC v2.
The project is MVC 3, but ApprovalUtilities is built against MVC 2, so this is probably why NCrunch decided to load it. I still have v2 on my machine because I still have some sites that are built against v2. If you think I'm right that the two versions of MVC are causing the problem, then I'm happy at this point to know what the problem was. But I'd also like to put MVC 2 back on the machine at some point in the future.
Any thoughts?