WP 8.1 XAML 应用程序在 MapControl 的 Windows 10 Mobile 上时常崩溃

WP 8.1 XAML app crushes time to time on the Windows 10 Mobile at MapControl

我们 Windows Phone 8.1 Xaml 应用程序在 windows 10 交付给我们的测试 phone 时开始测试,尤其是 Lumia 640XL和 Lumia 930。

而且我们遇到了应用程序在任何时间和任何地点意外关闭的问题。没有任何场景可以重现它。

托管调试器报告 "ExecutionEngineException" 没有任何细节和任何堆栈。

本机调试器报告访问冲突,请调查下面的调用堆栈。

请帮我想办法找到暗恋的原因!

P.S。该应用程序在 windows phone 8.1

上完美运行

coreclr.dll!ComCallWrapper::GetComIPFromCCW(class ComCallWrapper *,struct _GUID const &,class MethodTable *,enum GetComIPFromCCW::flags) 未知 coreclr.dll!Unknown_QueryInterface_Internal(class ComCallWrapper *,struct IUnknown *,struct _GUID const &,void * *) 未知 coreclr.dll!Unknown_QueryInterface(struct IUnknown *,struct _GUID const &,void * *) 未知 Windows.UI.Xaml.dll!6bdd84b0() 未知 Windows.UI.Xaml.Maps.dll!6335a582() 未知 Windows.UI.Xaml.Maps.dll!6332aa3c() 未知 Windows.UI.Xaml.Maps.dll!6335168a() 未知 Windows.UI.Xaml.Maps.dll!633523f8() 未知 Windows.UI.Xaml.Maps.dll!63359e60() 未知 Windows.UI.Xaml.dll!6bd202c2() 未知 Windows.UI.Xaml.dll!6bece3a4() 未知 Windows.UI.Xaml.dll!6bd09ff8() 未知 Windows.UI.Xaml.dll!6bd09f16() 未知 Windows.UI.Xaml.dll!6bd0d000() 未知 Windows.UI.Xaml.dll!6bd0cbb6() 未知 Windows.UI.Xaml.dll!6bd0cab8() 未知 Windows.UI.Xaml.dll!6bd0c8d4() 未知 Windows.UI.Xaml.dll!6bd0c836() 未知 Windows.UI.Xaml.dll!6bd0c7ba() 未知 Windows.UI.Xaml.dll!6bd7ef74() 未知 MinUser.dll!7740b816() 未知 MinUser.dll!774082b0() 未知 Windows.UI.dll!6df2f0ea() 未知 Windows.UI.dll!6df2ef72() 未知 Windows.UI.dll!6df2eeca() 未知 Windows.UI.Xaml.dll!6bf0501a() 未知 Windows.UI.Xaml.dll!6bf04fdc() 未知 Windows.UI.Xaml.dll!6bf04e9c() 未知 twinapi.appcore.dll!75eb352a() 未知 twinapi.appcore.dll!75eaef88() 未知 SHCore.dll!763643a2() 未知 ntdll.dll!77a154ba() 未知

在升级到最新的 Insider 版本 (10.0.14295.1000) 后,我们的应用程序刚刚出现了类似的问题。地图控件在 Windows 10 Mobile 上崩溃,但在此之前,Visual Studio 需要来自 OS 的丢失文件:"uielement.cpp"。它还给出了已知位置:"d:\rs1\onecoreuap\windows\dxaml\xcp\core\core\elements\uielement.cpp"。

有谁知道这个丢失的文件在哪里?也许我们缺少 SDK 的一些新部分?

找不到文件后,抛出异常:

Unhandled exception at 0x633FB4B1 (Windows.UI.Xaml.dll) in ***.exe: 0xC0000005: Access violation reading location 0x00000000.

据我所知,位置 0x00000000 为 NULL。

"Output Window":

Exception thrown at 0x7799D247 in ***.exe: Microsoft C++ exception: web::http::http_exception at memory location 0x0426F3C8.

Exception thrown at 0x7799D247 in ***.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.

Exception thrown at 0x7799D247 in ***.exe: Microsoft C++ exception: web::http::http_exception at memory location 0x0426F3C8.

Exception thrown at 0x7799D247 in ***.exe: Microsoft C++ exception: web::http::http_exception at memory location 0x06D8F9D0.

Unhandled exception at 0x633FB4B1 (Windows.UI.Xaml.dll) in ***.exe: 0xC0000005: Access violation reading location 0x00000000.

"Source Search"详情:

Locating source for 'd:\rs1\onecoreuap\windows\dxaml\xcp\core\core\elements\uielement.cpp'. Checksum: MD5 {7 d7 a1 1e 56 b b 82 cf a4 b6 bd 97 32 30 bd} The file 'd:\rs1\onecoreuap\windows\dxaml\xcp\core\core\elements\uielement.cpp' does not exist. Looking in script documents for 'd:\rs1\onecoreuap\windows\dxaml\xcp\core\core\elements\uielement.cpp'... Looking in the Edit-and-Continue directory 'C:***\enc_temp_folder\'... The file with the matching checksum was not found in the Edit-and-Continue directory. Looking in the projects for 'd:\rs1\onecoreuap\windows\dxaml\xcp\core\core\elements\uielement.cpp'. The file was not found in a project. Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\vc7\atlmfc'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\vc7\crt'... Looking in directory 'c:\'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\src\mfc'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\src\mfcm'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\src\atl'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\crt\src'... Looking in directory 'C:\Program Files (x86)\Windows Kits\Source.0.10240.0\ucrt'... Looking in directory ''... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include'... Looking in directory 'C:\Program Files (x86)\Windows Kits\Include.0.10240.0\ucrt'... Looking in directory 'C:\Program Files (x86)\Windows Kits.1\Include\um'... Looking in directory 'C:\Program Files (x86)\Windows Kits.1\Include\shared'... Looking in directory 'C:\Program Files (x86)\Windows Kits.1\Include\winrt'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\src\mfc'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\src\mfcm'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\src\atl'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\crt\src'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include'... Looking in directory 'C:\Program Files (x86)\Windows Phone Kits.1\Include'... Looking in directory 'C:\Program Files (x86)\Windows Phone Kits.1\Include\abi'... Looking in directory 'C:\Program Files (x86)\Windows Phone Kits.1\Include\mincore'... Looking in directory 'C:\Program Files (x86)\Windows Phone Kits.1\Include\minwin'... Looking in directory 'C:\Program Files (x86)\Windows Phone Kits.1\Include\wrl'... The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: d:\rs1\onecoreuap\windows\dxaml\xcp\core\core\elements\uielement.cpp. The debugger could not locate the source file 'd:\rs1\onecoreuap\windows\dxaml\xcp\core\core\elements\uielement.cpp'.

注意:该应用程序适用于 Windows 10 Mobile 的先前版本,并且仍然适用于 Windows 8.1。

我找到了应用程序崩溃的原因。如果 GC 尝试释放包含子集合中的自定义 XAML 控件的地图控件,就会发生这种情况。

所以要修复它,您必须在地图的卸载事件中从地图中删除所有子项。