Paul Spencer
Paul Spencer

Reputation: 870

how to step into system.web.mvc

Does anyone have know how I can step into system.web.mvc? I am getting an error (Cannot create an abstract class) that is buried in the System.Web.Mvc.DefaultModelBinder.CreateModel method, and I can't tell which part of my code is causing the issue.

I was advised that I could download the sourcecode from codeplex, (actually microsoft.com/downloads as I am using 1.0), build in Debug and then step through. I tried, unfortunately the system.web.mvc was installed in GAC, thus causing an ambiguous call, and gacutil would not allow me to uninstall, so tried by hand removing from the registry (HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Global\system.web.mvc). when I ran my program it was still reporting an ambiguous call.

Background

A couple of weeks ago I had a problem where MVC was throwing up a YSOD, but I could not step into the code to find the problem because the issue was I was doing something wrong, that was not being picked up until it was in the framework (in this case, by thrashing around blindly for a day I found it was that I didn't have a default empty constructor on one of the classes within my viewmodel). Now I am getting a different error (Cannot create an abstract class) that is buried in the System.Web.Mvc.DefaultModelBinder.CreateModel method, but I don't know what part of my code is causing the error in the framework.

Upvotes: 3

Views: 1005

Answers (2)

Craig Stuntz
Craig Stuntz

Reputation: 126547

It's a little involved, but you can do it. Steve Sanderson has step-by-step instructions.

Upvotes: 3

Paul Creasey
Paul Creasey

Reputation: 28834

If you have the source code then you can recompile the code using a different assembily name and reference that.

Upvotes: 1

Related Questions