Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging ASP.NET MVC source?

Trying to debug into ASP.NET MVC 1.0 source, I followed instructions like these, basically remove reference to system.web.mvc from my web project and add the source project I downloaded instead.

Now, I have this problem,

The type 'System.Web.Mvc.FormMethod' exists in both 'c:\Windows\assembly\GAC_MSIL\System.Web.Mvc\1.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll' and in my AppData\Local\Temp\Temporary ASP.NET Files\root\dbcbb149\897fc019\assembly\dl3\796c00fb\f345f2d6_abe3c901\System.Web.Mvc.DLL'

I tried commenting out the following from web.config

<add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

but it'll give a difference error

The type 'System.Web.Mvc.Controller' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Could someone help on what's going wrong and how to fix it. Thank you very much!

Ray.

like image 758
Ray Avatar asked Jun 02 '09 19:06

Ray


2 Answers

There is no need to uninstall ASP.NET MVC from GAC! (or any any <assemblyBinding>s) Just follow "Using the ASP.NET MVC source code to debug your app" article step by step.

There are a couple of questions similar to yours:

  • How can you use ASP.NET MVC build from source rather than the GAC?
  • MVC. Strongly-typed view difference (MVC sources vs. assembly)
like image 136
eu-ge-ne Avatar answered Oct 19 '22 14:10

eu-ge-ne


Are the system.web.mvc assemblies in the GAC? you might need to remove them ... this of course could mess up future projects as the project templates will likely assume that they are in the gac.

You could also try using the <assemblyBinding> feature as described here to point the mvc stuff to the version that you are running.

like image 1
Joel Martinez Avatar answered Oct 19 '22 14:10

Joel Martinez