我有一个奇怪的问题 - 在我的MVC 5应用程序上运行调试会话时,应用程序永远不会在浏览器中加载。在执行任何代码之前,系统会在VS中无休止地循环执行错误。它似乎在IIS express初始化期间挂起(加载其库)。这是我目前所知道的:
行为:
在输出窗口中,我看到以下日志信息:
'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.
最后一个错误一遍又一遍地重复,穿插线程退出消息。在成功启动调试会话的情况下,此日志输出启动相同,但在加载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.
(在成功的会议中我还没有显示其他许多行
这让我相信也许某些事情阻止了System.Web的加载,或者加载mscorlib时出现了问题。
以下是我尝试的内容:
任何线索都将非常感谢!
答案 0 :(得分:0)
好吧,经过多次拉毛后,这个问题与Application Insights有关。几个月前我在应用程序中添加了AI,没有任何问题。但是最近访问我的Azure门户时出现了问题(我相信公司防火墙问题),这阻止了AI正确登录或访问它的Web组件。我的理论是,在第一次运行应用程序时,一切都很好,但在后台,AI组件正在努力连接。然后,当应用程序关闭时,组件未正确卸载,因为它们挂在连接上。然后在第二次运行时(仅当我由于某种原因重建时),由于'System.CannotUnloadAppDomainException'错误,应用程序的init失败。
我不明白,但我确信删除所有AI引用已解决了这个问题。感谢所有考虑过这一点的人!