简体   繁体   English

重建后ASP.NET调试挂起

[英]ASP.NET Debug hangs after Rebuild

I have an odd problem - when running a debug session on my MVC 5 app, the app never loads in the browser. 我有一个奇怪的问题-在我的MVC 5应用程序上运行调试会话时,该应用程序永远不会加载到浏览器中。 The system endlessly cycles through an error in VS, before any code is executed. 在执行任何代码之前,系统会无休止地循环遍历VS中的错误。 It seems to hang during the IIS express initialization (loading its libraries). 在IIS快速初始化(加载其库)期间,它似乎挂起了。 Here's what I know so far: 这是我目前所知道的:

Behavior: 行为:

  • Upon initial launch of VS 2015, app runs fine. 最初启动VS 2015时,应用运行良好。
  • After changing a line or two of code - javascript, C#, doesn't matter, anything that triggers a re-build - it no longer will launch in the debugger. 更改一行或两行代码后-javascript,C#无关紧要,任何触发重新构建的操作-不再会在调试器中启动。 Even changing back to undo your code change, does not recover. 即使更改回撤消您的代码更改,也无法恢复。
  • Recovery is possible only by re-starting VS 2015. 只有重新启动VS 2015才能进行恢复。
  • My app is MVC 5, not using any vNext stuff in my app, however I do have ASP.NET 5 RC1-Update 1 installed. 我的应用程序是MVC 5,未在我的应用程序中使用任何vNext东西,但是我确实安装了ASP.NET 5 RC1-Update 1。 I am using Typescript and .scss files. 我正在使用Typescript和.scss文件。

    In the output window, I see the following logging info: 在输出窗口中,我看到以下日志记录信息:

     'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_32\\mscorlib\\v4.0_4.0.0.0__b77a5c561934e089\\mscorlib.dll'. Cannot find or open the PDB file. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_32\\System.Web\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Web.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Core\\v4.0_4.0.0.0__b77a5c561934e089\\System.Core.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Web.ApplicationServices\\v4.0_4.0.0.0__31bf3856ad364e35\\System.Web.ApplicationServices.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Configuration\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Caching\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.Caching.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\Microsoft.Build.Utilities.v4.0\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\Microsoft.Build.Utilities.v4.0.dll'. Cannot find or open the PDB file. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Web.RegularExpressions\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Web.RegularExpressions.dll'. Cannot find or open the PDB file. 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/3/ROOT-3-131015937881507859): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_32\\mscorlib\\v4.0_4.0.0.0__b77a5c561934e089\\mscorlib.dll'. Cannot find or open the PDB file. The thread 0x21ec has exited with code 0 (0x0). Exception thrown: 'System.CannotUnloadAppDomainException' in Unknown Module. Exception thrown: 'System.CannotUnloadAppDomainException' in Unknown Module.\n'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_32\\mscorlib\\v4.0_4.0.0.0__b77a5c561934e089\\mscorlib.dll'. Cannot find or open the PDB file. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_32\\System.Web\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Web.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Core\\v4.0_4.0.0.0__b77a5c561934e089\\System.Core.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Web.ApplicationServices\\v4.0_4.0.0.0__31bf3856ad364e35\\System.Web.ApplicationServices.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Configuration\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime.Caching\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.Caching.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\Microsoft.Build.Utilities.v4.0\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\Microsoft.Build.Utilities.v4.0.dll'. Cannot find or open the PDB file. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Web.RegularExpressions\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Web.RegularExpressions.dll'. Cannot find or open the PDB file. 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/3/ROOT-3-131015937881507859): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_32\\mscorlib\\v4.0_4.0.0.0__b77a5c561934e089\\mscorlib.dll'. Cannot find or open the PDB file. The thread 0x21ec has exited with code 0 (0x0). Exception thrown: 'System.CannotUnloadAppDomainException' in Unknown Module. Exception thrown: 'System.CannotUnloadAppDomainException' in Unknown Module. 

    The last error repeats itself over and over, interspersed with the thread exit message. 最后一个错误一遍又一遍地重复,并散布在线程退出消息中。 In the case of a successful launch of a debug session, this log output starts the same, but immediately after the loading of mscorlib are these lines: 在成功启动调试会话的情况下,此日志输出将以相同的方式开始,但是在加载mscorlib之后立即显示以下行:

     /ROOT-1-131015945372332716): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_32\\System.Web\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Web.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/3/ROOT-1-131015945372332716): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/3/ROOT-1-131015945372332716): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Core\\v4.0_4.0.0.0__b77a5c561934e089\\System.Core.dll'. Symbols loaded. 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/3/ROOT-1-131015945372332716): Loaded 'C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Web.ApplicationServices\\v4.0_4.0.0.0__31bf3856ad364e35\\System.Web.ApplicationServices.dll'. Symbols loaded. 

    (There are many other lines following these that I didn't show, in a successful session) (在成功的会议中,还有很多其他我没有提到的内容)

    This leads me to believe perhaps something is preventing the loading of System.Web, or something went wrong with the loading of mscorlib. 这使我相信也许是某些原因阻止了System.Web的加载,或者mscorlib的加载出现了问题。

    Here's what I've tried: 这是我尝试过的:

  • Killing and re-starting IIS Express between debug runs - after killing IIS Express, and hitting F5 again, the process hangs before IIS exp ever gets re-started. 在调试运行之间终止并重新启动IIS Express-终止IIS Express,然后再次按F5后,该过程将挂起,直到重新启动IIS exp。
  • Un-installed, re-installed IIS Express 10 卸载,重新安装IIS Express 10
  • Disabled several VS extensions 禁用了几个VS扩展
  • Ran Repair on my .NET Framework 4.6.1 install .NET Framework 4.6.1安装上的Ran修复
  • Removed/Re-installed ASP.NET 5 RC1-Update 1 删除/重新安装ASP.NET 5 RC1-Update 1
  • Deleted .suo file, .vs folder, IIS temporary files 删除的.suo文件,.vs文件夹,IIS临时文件
  • Had colleague reproduce on her machine, same behavior 如果同事在她的机器上复制,行为相同
  • Ran without debugging, same behavior 不用调试即可运行,行为相同

    Any clues would be greatly appreciated! 任何线索将不胜感激!

  • Well, after much hair-pulling this issue turned out to be related to Application Insights. 好吧,经过反复梳理,这个问题最终与Application Insights有关。 I added AI to the app several months ago, with no issues. 我几个月前就将AI添加到了该应用中,没有任何问题。 But recently there has been a problem accessing my Azure portal (company firewall issue I believe), that has prevented AI from properly logging in or accessing it's web components. 但是最近访问我的Azure门户时遇到了一个问题(我认为是公司防火墙问题),这阻止了AI正确登录或访问其Web组件。 My theory is that upon first run of the app, all is well but in the background the AI components are struggling to connect. 我的理论是,在首次运行该应用程序时,一切都很好,但是在后台,AI组件却难以连接。 Then when the app is closed, the components are not unloaded properly because they are hung on connection. 然后,当应用程序关闭时,由于它们挂在连接上,因此无法正确卸载组件。 Then upon the second run (only if I've rebuilt, for some reason), the init of the app fails due to the 'System.CannotUnloadAppDomainException' error. 然后,在第二次运行时(仅出于某种原因,仅当我已重建时),由于“ System.CannotUnloadAppDomainException”错误,应用程序的初始化失败。

    I don't understand it but I'm sure that removing all AI references has resolved the issue. 我不理解,但是我敢肯定,删除所有AI参考可以解决此问题。 Thanks for all who pondered this! 感谢所有思考此问题的人!

    声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

     
    粤ICP备18138465号  © 2020-2024 STACKOOM.COM