如何修复 Win UI C# 应用程序已退出,代码为 -1073740791 (0xc0000409)

发布于 2025-01-19 21:35:23 字数 656 浏览 3 评论 0 原文

我有两个问题,我正在尝试执行 WIN UI 教程 (https://learn.microsoft.com/en-us/windows/apps/winui/winui3/create-your-first-winui3-app)用于创建我的第一个 WINUI 3 应用程序。我按照所有步骤操作,但收到错误“应用程序已退出,代码为 -1073740791 (0xc0000409)”。我已将 WindowPackageType 作为 none 添加到 csproj 文件中,但仍然一无所获。

 The other issue I am having is  that the SDK is showing yellow triangles, how to go about correcting that?

SDK 显示黄色三角形

任何帮助将不胜感激。

谢谢你,

比尔·O.

I have two issues, I am trying to do the WIN UI tutorial (https://learn.microsoft.com/en-us/windows/apps/winui/winui3/create-your-first-winui3-app) for creating my first WINUI 3 application. I follow all of the steps but get the error "application has exited with code -1073740791 (0xc0000409)." I have added the WindowPackageType as none to the csproj file and still I get nothing.

 The other issue I am having is  that the SDK is showing yellow triangles, how to go about correcting that?

SDK showing yellow triangle

Any help would be greatly appreciated.

Thank you,

Bill O.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦巷 2025-01-26 21:35:23
  1. 选择 x64 构建配置
  2. 将这些属性添加到您的项目
      <PropertyGroup>
       <WindowsSdkPackageVersion>10.0.19041.18</WindowsSdkPackageVersion>
        <WindowsPackageType>None</WindowsPackageType>
        <PlatformTarget>x64</PlatformTarget>
        <GeneratePackageOnBuild>False</GeneratePackageOnBuild>
      </PropertyGroup>
  1. 确保您的 VS 未启动提升。

  2. 升级到 Windows App SDK 1.1 pre2。

  3. 您也可以添加这些属性以进行故障排除

  <PropertyGroup>
    <WindowsAppSDKBootstrapAutoInitializeOptions_Default>true</WindowsAppSDKBootstrapAutoInitializeOptions_Default>
    <WindowsAppSDKBootstrapAutoInitializeOptions_OnNoMatch_ShowUI>true</WindowsAppSDKBootstrapAutoInitializeOptions_OnNoMatch_ShowUI>
    <WindowsAppSDKBootstrapAutoInitializeOptions_OnError_DebugBreak>true</WindowsAppSDKBootstrapAutoInitializeOptions_OnError_DebugBreak>
    <WindowsAppSDKBootstrapAutoInitializeOptions_OnError_DebugBreak_IfDebuggerAttached>true</WindowsAppSDKBootstrapAutoInitializeOptions_OnError_DebugBreak_IfDebuggerAttached>
  </PropertyGroup>
  1. Select x64 build configuration
  2. Add these properties to your project
      <PropertyGroup>
       <WindowsSdkPackageVersion>10.0.19041.18</WindowsSdkPackageVersion>
        <WindowsPackageType>None</WindowsPackageType>
        <PlatformTarget>x64</PlatformTarget>
        <GeneratePackageOnBuild>False</GeneratePackageOnBuild>
      </PropertyGroup>
  1. Make sure your VS isn't started elevated.

  2. Upgrade to Windows App SDK 1.1 pre2.

  3. Optional you can add these properties as well for troubleshooting purposes

  <PropertyGroup>
    <WindowsAppSDKBootstrapAutoInitializeOptions_Default>true</WindowsAppSDKBootstrapAutoInitializeOptions_Default>
    <WindowsAppSDKBootstrapAutoInitializeOptions_OnNoMatch_ShowUI>true</WindowsAppSDKBootstrapAutoInitializeOptions_OnNoMatch_ShowUI>
    <WindowsAppSDKBootstrapAutoInitializeOptions_OnError_DebugBreak>true</WindowsAppSDKBootstrapAutoInitializeOptions_OnError_DebugBreak>
    <WindowsAppSDKBootstrapAutoInitializeOptions_OnError_DebugBreak_IfDebuggerAttached>true</WindowsAppSDKBootstrapAutoInitializeOptions_OnError_DebugBreak_IfDebuggerAttached>
  </PropertyGroup>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文