Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 如何插入/调试web.api 2和System.web dll的源代码_Asp.net_Debugging_Asp.net Web Api_Visual Studio Debugging - Fatal编程技术网

Asp.net 如何插入/调试web.api 2和System.web dll的源代码

Asp.net 如何插入/调试web.api 2和System.web dll的源代码,asp.net,debugging,asp.net-web-api,visual-studio-debugging,Asp.net,Debugging,Asp.net Web Api,Visual Studio Debugging,我想深入了解/调试WebAPI2(版本5.2.3)的源代码以理解它 我创建了一个简单的web api应用程序,在WebApi.config中,我在这一行设置了一个断点: config.Routes.MapHttpRoute( name: "ExcludedRoute", routeTemplate: "api/{controller}/{action}", defaults: new { id = RouteParameter.

我想深入了解/调试WebAPI2(版本5.2.3)的源代码以理解它

我创建了一个简单的web api应用程序,在WebApi.config中,我在这一行设置了一个断点:

 config.Routes.MapHttpRoute(
           name: "ExcludedRoute",
           routeTemplate: "api/{controller}/{action}",
           defaults: new { id = RouteParameter.Optional },
           constraints: new { Controller = "healthcheck", action = "check" }
       );
我可以跨入MapHttpRoute方法和其他类,但调试器无法跨入图像下方System.Webdll中的Route类:

我尝试使用此符号文件位置:

我还使用dotpeek工具从bin文件夹生成pdb文件,方法是将引用程序集的“复制本地”功能设置为true,但没有成功。system.web dll的路径为

C:\ProgramFiles(x86)\Reference Assembly\Microsoft\Framework.NETFramework\v4.5\System.Web.dll

我想知道为什么调试器不能进入路由类,它属于system.Web dll,它的版本是4.0,Web.api的版本是5.2.3

在搜索过程中,我下载了asp.net的源代码,发现project System.Web.Http.WebHost包含HttpWebRoute类

有什么想法吗


谢谢

Assembly System.Web.pdb位于.NET Framework源代码中。您需要在工具->选项->调试->常规菜单中配置Visual Studio以调试.NET framework

参考:


正如我在问题中提到的,我已经用标准源服务器配置了VisualStudio,但结果并不理想。我更喜欢使用dotpeek工具生成pdb文件,但即使这样,system.web.pdb也不允许我进入route类。@Issa Dawaji,所以您设置了正确的设置,如以下文档:,对吗?如果是这样,在调试应用程序期间,您是否收到任何警告或错误消息?