Asp.net 如何在System.Web.Compilation.BuildManager中进行调试

Asp.net 如何在System.Web.Compilation.BuildManager中进行调试,asp.net,debugging,iis,compilation,Asp.net,Debugging,Iis,Compilation,如何调试内部事件?它在IIS/ASP.net生命周期的哪个阶段被称为 问题是我有一些代码使用了,但似乎没有启动。因此,我正在尝试找出将调试器附加到它的最佳方法 这里有关于更大问题的更多细节 但我已经把它打破了 一个较小的问题,试图取得一些进展 到目前为止,我只能识别以下调用堆栈 BuildManager.CallPreStartInitMethods-> 建筑经理。​GetPreStartInitMethodsFromAssemblyCollection() 我正在处理一个类似的问题(或者可能是

如何调试内部事件?它在IIS/ASP.net生命周期的哪个阶段被称为

问题是我有一些代码使用了,但似乎没有启动。因此,我正在尝试找出将调试器附加到它的最佳方法

这里有关于更大问题的更多细节 但我已经把它打破了 一个较小的问题,试图取得一些进展

到目前为止,我只能识别以下调用堆栈

BuildManager.CallPreStartInitMethods-> 建筑经理。​GetPreStartInitMethodsFromAssemblyCollection()

我正在处理一个类似的问题(或者可能是同一个问题),可以为您提供完整的堆栈跟踪。顺便说一句,您可以自己生成它,只需创建一个简单的小型MVC应用程序,并在使用PreApplicationStartMethodAttribute调用的方法中引发异常。您将获得:

[ApplicationException: joe was here]
   MvcApplication2.JoeStart.Start() in c:\Users\Joe\Documents\Visual Studio 2012\Projects\MvcApplication2\MvcApplication2\JoeStart.cs:18

[InvalidOperationException: The pre-application start initialization method Start on type MvcApplication2.JoeStart threw an exception with the following error message: joe was here.]
   System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +550
   System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +132
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +90
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +135
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516

[HttpException (0x80004005): The pre-application start initialization method Start on type MvcApplication2.JoeStart threw an exception with the following error message: joe was here.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9873784
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

检查“更大的问题”的问题,我发布了一个答案,可能会澄清这个问题。