问题
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:
- Compile the MVC code.
- Uninstall the MVC (To make sure you don't debug the retail bits)
- 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