【问题标题】:UWP App crash in release mode (faulting module: Windows.UI.Xaml.dll)UWP App 在发布模式下崩溃(故障模块:Windows.UI.Xaml.dll)
【发布时间】:2021-05-27 22:37:14
【问题描述】:

我的 UWP 应用在发布模式下启动后直接崩溃,并在事件日志中显示以下错误:

错误应用程序名称:MyApp.exe,版本:1.0.0.0,时间戳:0x6037ab09 错误模块名称:Windows.UI.Xaml.dll,版本:10.0.17763.1790,时间戳:0x05b3601b 异常代码:0xc000027b

当我安装调试版本时,一切都很好。

【问题讨论】:

    标签: uwp xamarin.uwp


    【解决方案1】:

    我在 5.00 版中使用 Microsoft.Extensions.Logging 和 Microsoft.Extensions.Options。事实证明,本机编译器正在剥离运行时需要的一些部分。

    我在这个 github 问题中找到了描述和解决方案:https://github.com/dotnet/runtime/issues/44697

    所以我必须将所有程序集添加到位于 Properties 下的 Default.rd.xml:

    <Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
        <Application>
            <Assembly Name="*Application*" Dynamic="Required All" />
            
            <!-- Add your application specific runtime directives here. -->
            <Assembly Dynamic="Required All" Name="Microsoft.Extensions.Options"/>
            <Assembly Dynamic="Required All" Name="Microsoft.Extensions.Logging"/>
            <Assembly Dynamic="Required All" Name="Microsoft.Extensions.Logging.Abstractions"/>
            <Assembly Dynamic="Required All" Name="Microsoft.Extensions.Hosting"/>
        </Application>
    </Directives>
    

    【讨论】:

      猜你喜欢
      • 2019-04-08
      • 2020-03-01
      • 2017-10-29
      • 1970-01-01
      • 1970-01-01
      • 2021-07-17
      • 2019-11-02
      • 1970-01-01
      • 2021-11-27
      相关资源
      最近更新 更多