问题描述
我正在创建一个Windows Store应用程序,该应用程序具有用于后台任务的Windows运行时组件.
I have a Windows Store application that I am creating that has a Windows Runtime Component for a background task.
该解决方案在Visual Studio中构建时没有问题,但是在触发后台任务时,该解决方案始终会失败,并显示消息程序'[4204] backgroundTaskHost.exe'已退出,代码为1(0x1)".
The solution builds with no problems in Visual Studio but when the background task is triggered, it always fails with the message "The program '[4204] backgroundTaskHost.exe' has exited with code 1 (0x1)."
对包含后台任务的项目的引用位于主项目中,并且我正在设置入口点,因此我不知道问题出在哪里.我如何获得有关程序退出原因的更多信息?
The reference to the project containing the background task is in the main project and I am setting the entry point, so I don't know what the problem is. How do I get more information as to why the program is exiting?
推荐答案
我的入口点的名称空间有误.命名空间为"App.BackgroundServices",任务为"ToastBackgroundTask".我本应该拥有App.BackgroundServices.ToastBackgroundTask
的时候才拥有BackgroundServices.ToastBackgroundTask
.
My namespace was wrong on my entrypoint. Namespace was "App.BackgroundServices", task was "ToastBackgroundTask". I just had BackgroundServices.ToastBackgroundTask
when I should have had App.BackgroundServices.ToastBackgroundTask
.
这篇关于backgroundTaskHost.exe退出,代码为1(0x1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!