【发布时间】:2013-09-27 06:52:52
【问题描述】:
在 WinRT 应用中,当将 调试器类型切换为混合(从托管)时,应用程序无法启动。暂停调试器显示执行在:
static void Main(string[] args)
{
global::Windows.UI.Xaml.Application.Start((p) => new App());
}
输出窗口不断将 EETypeLoadExceptions 显示为不同的内存位置:
ApplicationName.exe 中 0x757E4B32 处的第一次机会异常:Microsoft C++ 异常:内存位置 0x0BF7D134 处的 EETypeLoadException。
看起来CLR异常是:
CLR:(C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll) Rejecting native image because native image dependency C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll had a different identity than expected
我需要为 SOS 调试扩展 (SOS.dll)
使用本机调试器当创建一个新的空白应用程序,然后添加与我的应用程序相同的依赖项时,我没有遇到此问题,因此这是我的应用程序特有的问题。
关于问题是什么或如何进一步排除故障的任何想法?任何有在 WinRT 应用中使用 SOS 调试扩展 (SOS.dll) 经验的人?
【问题讨论】:
-
查看托管异常来调试这一点很重要,本机异常没有帮助。 Debug + Exceptions,勾选 CLR exceptions 的 Throw 复选框。
-
看起来像是来自 Ninject:
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll Additional information: Could not load file or assembly 'Ninject.Extensions.*.dll' or one of its dependencies. The system cannot find the file specified. -
另一种诊断模块加载问题的有用方法是使用 sysinternals 进程监视器来监视您的应用程序启动。您可以查找有问题的 DLL,并查看应用程序在尝试加载它时探测的所有位置,然后找出所需的 DLL 不在这些位置之一的原因。
标签: windows-8 windows-runtime winrt-xaml sos