How can I find the asp.net mvc 4.0 source code matching my 4.0 assembly

Topics: ASP.NET MVC
Oct 14, 2012 at 9:54 PM
Edited Oct 14, 2012 at 9:58 PM

Hello,

I would like to debug the asp.net mvc 4.0 source code to understand more and debug some exceptions I can not explain.

My MVC 4.0 project registers the System.Web.Mvc assembly version 4.0.0.0.

Which is the coresponding source code to the above assembly version?

Would someone please paste me a link?

I can not find it.

 

When I download the latest source code: aspnetwebstack-e0115a823029 , rebuild the system.web.mvc project and include it in my project to debug it I get the error that the WebPages 2.1 is used by this project, but my project references WebPages 2.0.

So it seems I use the wrong or a too new version of the source code.

Oct 15, 2012 at 10:26 PM
BastienPascal wrote:

I would like to debug the asp.net mvc 4.0 source code to understand more and debug some exceptions I can not explain.

My MVC 4.0 project registers the System.Web.Mvc assembly version 4.0.0.0.

Which is the coresponding source code to the above assembly version?

Would someone please paste me a link?

Hi,

Please configure your Visual Studio debugger to point at the following symbol path: http://srv.symbolsource.org/pdb/Public

Oct 15, 2012 at 10:52 PM
Edited Oct 15, 2012 at 11:06 PM

Hello marcind,

I have configured like written here: http://www.symbolsource.org/Public/Home/VisualStudio

now I want to debug my return PartialView(); and say: "Step into" onto the code, but it does not step into it. A new Tab opens saying: "there is no source code available for this location"

Do you have any guess what is wrong?

Oct 16, 2012 at 6:42 PM

When debugging, can you open Debug -> Windows -> Modules, and sort the list by name, and verify that System.Web.Mvc.dll has symbols loaded? If not, right-click on the entry and select Load Symbols From -> Symbol Path.

Oct 16, 2012 at 8:42 PM

http://s1.directupload.net/file/d/3045/mk2uakpl_png.htm

I did what you said. Then a dialog has opened where I should open the .pdf folder but the one preselected has no .PDB file for system.web.mvc.

Please see the attached image. My whole pc has no system.web.mvc.PDB file.

Oct 16, 2012 at 9:18 PM

The same folder location that showed up for you in the dialog should contain the System.Web.Mvc.dll file. Could you check that file's properties and report back the version? It should be 4.0.20710.0.

Oct 16, 2012 at 9:45 PM
Edited Oct 16, 2012 at 10:00 PM

Its 4.0.20505.0

and all my Nuget stuff shows 20710.0.

I have read I can generate a .PDB file only from source. So I loaded the source Mvc project and built it with .pdb`s only.

I took the the .pdb file and copied it to the directory you have seen in the dialog (my screenshot). Then I followed your steps again to Load Symbols From -> Symbol Path.

The dialog opens again and I choose my generated .PDB file and get this message box:

"A matching symbol file was not found in this folder"

uh... what now?

Oct 16, 2012 at 11:20 PM
BastienPascal wrote:

Its 4.0.20505.0


What's happening is you have the Release Candidate of MVC 4 installed on your system. You need to uninstall that first (through the Add Remove Programs dialog) and install the RTM version of MVC 4.

Oct 17, 2012 at 9:22 AM
Edited Oct 17, 2012 at 5:10 PM

Can I not debug .PDb files with the RC 4.0 ? Why is that?

ah sorry I forgot, RTM is later than RC. I thought the other way round being confused.

Thanks I will install the new version and try again.

Oct 17, 2012 at 5:39 PM

Thanks again for you help it WORKS. its awesome to debug my favorite framework :P

Oct 17, 2012 at 7:03 PM

That's great. Happy debugging.

Nov 15, 2012 at 8:00 PM

I am having the same problem - unable to load ASP.NET MVC 4 symbols.

My setup:

  • Visual Studio 2012 RTM
  • I have http://srv.symbolsource.org/pdb/Public in my symbol path, among other things
  • The version is  System.Web.Mvc.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Mvc\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll Yes N/A Cannot find or open the PDB file. 15 4.0.20710.0 7/10/2012 8:47 PM 000007FEE6C40000-000007FEE6EC9000 [2628] w3wp.exe: Managed (v4.0.30319)

When I right-click and select load symbols-> Microsft servers I get  "C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Mvc\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll: Cannot find or open the PDB file." System.Web.dll loads symbols just fine in the same manner.

Help? There's a related question on stack overflow, without answer: http://stackoverflow.com/questions/13050395/where-are-the-symbols-for-asp-net-mvc-4-0-rtm 

Thanks!

Nov 25, 2012 at 3:17 AM

I'm in the same situation as DenNukem. Dll version is the right one.

Jan 3, 2013 at 8:54 PM

I had exactly the same issue (correct version but no symbols), but after a day or so of trying everything I've been able to get it working. These are catch-all instructions that worked for me, they may contain unnecessary steps:

  1. Sign up for SymbolSource and follow the instructions using the authenticated URL form:
    http://www.symbolsource.org/Public/Home/VisualStudio
  2. Uninstall all versions of MVC with add/remove programs
  3. Remove MVC assembly from the GAC (the question is about modifying MVC but the GAC answer is good):
    http://stackoverflow.com/questions/1633146/installing-a-modified-version-of-asp-net-mvc
  4. Remove and then reinstall MVC reference to your application with NuGet
  5. Start debugging, open the modules window, and cross your fingers that ‘Symbols loaded’ is next to System.Web.MVC when it appears.

 

(sprinkle in restarts as you see fit, for me the key final step was reinstalling the NuGet reference)

My theory is that as the GAC library is used at runtime in preference to the local reference, the symbols are not found when they are searched for. By removing MVC from the GAC and then reinstalling the NuGet reference, it seems the local reference is used and the symbols are found. It's counterintuitive as the System.Web.MVC.dll files are binary-equivalent between NuGet and the GAC, although they are dated differently.

I'm not totally convinced though as I tried to do the same thing for Razor and that didn't work.