首页 > 解决方案 > Cannot step into MVC4 methods

问题描述

I've followed the steps in this answer to try and step into an MVC4 method (System.Web.Mvc.UrlHelper.Action) and it still won't work; when I debug my controller action and hit F11 on the line that calls Action(), it doesn't step into it, it just silently steps over with no popup or anything:

  var urlHelper = new UrlHelper(htmlHelper.ViewContext.RequestContext);
  var myGuid = Guid.NewGuid();
* return urlHelper.Action(actionName, "Room", new { companyId = myGuid });

During the initial site loading, in the output Debug window, I get:

'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/4/ROOT-1-131760323543445359): Loaded 'C:\Users\Jez\AppData\Local\Temp\Temporary ASP.NET Files\vs\55b8e42d\c314116e\assembly\dl3\8aef13b9\0036c3f9_8675cd01\System.Web.Mvc.dll'. Cannot find or open the PDB file.

So it looks like the reason it can't step into MVC4 code is that it can't open the PDB file for my version of MVC4. If I F12 into the method I want to debug, the metadata shows:

#region Assembly System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// C:\Development\close.global-core\packages\Microsoft.AspNet.Mvc.4.0.20710.0\lib\net40\System.Web.Mvc.dll
#endregion

As I have followed the steps in the answer I linked, I already have these URLs setup in my symbol server Symbols locations:

So I can't understand why it doesn't get the PDB file - shouldn't these allow me to debug MVC4 methods?

标签: asp.net-mvcasp.net-mvc-4debugging

解决方案


推荐阅读