独立的WinRT IBackgroundTask

问题描述 投票:0回答:1

我遵循 Microsoft 文档并创建了在 dotnet8 上运行的工作 WinRT IBackgroundTask。现在我想将它与我的应用程序集成,该应用程序部署为独立的,并且不需要 dotnet 8 的框架部署。我尝试从此修改 WinRT.Host.runtimeconfig.json

{
  "runtimeOptions": {
    "tfm": "net8.0",
    "rollForward": "LatestMinor",
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "8.0.0"
    }
  }
}

到此

{
  "runtimeOptions": {
    "tfm": "net8.0",
    "includedFrameworks": [
      {
        "name": "Microsoft.NETCore.App",
        "version": "8.0.3"
      }
    ],
  }
}

但它不起作用。有什么建议吗?

我在事件查看器中看到了这个

Application: backgroundTaskHost.exe
CoreCLR Version: 8.0.324.11423
.NET Version: 8.0.3
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.InteropServices.COMException (0x80080204)
   at MobiSystems.BackgroundTasks.CheckForUpdates.CheckForUpdatesBackgroundTask.RunExecutionAlias()
   at MobiSystems.BackgroundTasks.CheckForUpdates.CheckForUpdatesBackgroundTask.Run(IBackgroundTaskInstance taskInstance)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
uwp windows-runtime msix windows-rt
1个回答
0
投票

不支持请参阅此处:https://github.com/microsoft/CsWinRT/issues/1141

微软没有为.net core提供框架包,并告诉我们对打包应用程序使用独立部署,但也不支持独立应用程序中的功能。无价之宝。

© www.soinside.com 2019 - 2024. All rights reserved.