I want to debug (set a breakpoint in) System.Web.Mvc.DefaultControllerFactory, is that possible?

好久不见. 提交于 2019-12-09 17:56:07

问题


I have a project that references the System.Web.Mvc assembly in the GAC. I also have the ASP.NET MVC source code from Codeplex. I want to get a better understanding of the DefaultControllerFactory by stepping through its methods. How could I set this up?

Thanks!


回答1:


  1. Compile the MVC code.
  2. Uninstall the MVC (To make sure you don't debug the retail bits)
  3. Use the assembly that you compiled, instead of the retail.



回答2:


If you do download the MVC source files from Codeplex, I've written a step by step guide on how to debug the System.Web.Mvc assembly, which you may find useful.




回答3:


Your assemblies may be compiled in Release even if the Solution Configuratin drop down says Debug. It also may be that w3p.exe loaded your release assemblies.

1 -Use the Build->Configuration manager feature and make sure all of the project configurations are Debug. 2 - Build Clean 3 - Rebuild Solution 4 - iisreset (unloads Release assemblies if they're loaded) 5 - Invoke a page 6 - Attach process

hopefully the solid red circles show up now - best of luck



来源:https://stackoverflow.com/questions/701178/i-want-to-debug-set-a-breakpoint-in-system-web-mvc-defaultcontrollerfactory-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!