UWP app fails to start on login using the StartupTask APIs
NOTE: I've already looked at this related question, this is not a duplicate
I'm working on a UWP app which also uses the Desktop Bridge (the app package contains the UWP app and a WinForms component), and I'm trying to add the auto startup feature, so far without success.
Here's what I did:
Some research. Looked at this question mentioned before, this blog post from MS and at the official docs as well.
Followed the docs by editing the
Package.appxmanifest
file to add theuap5
namespace, and then theuap5:Extension
node as instructed, setting my app .exe file in theExecutable
property, andWindows.FullTrustApplication
in theEntryPoint
property.
Bonus: just in case, I also tried to replace theuap5
namespace withdesktop
, as some code samples used that one instead. Same result, the app doesn't start at all.- Included the APIs to get the startup task and request it to be setup.
- Deployed the app, proceeded to use those APIs, got the confirm window and tapped "allow".
- Opened the Task Managed and double checked that the app name was there under the "Startup" tab, with the "Enabled" label correctly shown next to it.
- Logged out and back in
At this point nothing happens, except from the mouse pointer showing the loading ring for half a second after logging in. Opened the Windows event viewer and found an error, which was indicating the failed auto startup for the app. Tried again a few times and sure enough, every time the app didn't start and another identical error popped up in the event viewer. This is the error info:
Application name: <my app>.exe, versione: 1.0.0.0, timestamp: 0x5a68410c
Module: KERNELBASE.dll, versione: 10.0.17134.407, timestamp: 0x99042cc0
Exception code: 0xe0434352
Offset: 0x000000000003a388
Process ID: 0x1c4c
Path: C:Users<my username>DocumentsGitHub<my app><my app>.Packagebinx64DebugAppX<my app>.exe
Module path: C:WindowsSystem32KERNELBASE.dll
[...]
I'm not sure what I'm doing wrong here, I've followed the docs step by step and I do see the app listed in the Task Manager, but it just fails to start this way.
Any help would be appreciated, thanks in advance! 😄
EDIT: it seems the problem is related to the Desktop Bridge functionality. I have a UWP app and a packaging project, and I've added the startup task to both the .appxmanifest
files (with different Ids). I do this as I use the packaging project to create the x86/x64 builds, and the UWP project directly for the ARM/ARM64 builds.
If I only deploy the UWP app (standalone, without the package) and enable the startup task, the app runs fine. But, if I deploy the packaging project and enable that startup task, the startup fails. I do see the startup task in the Task Manager in both cases. As mentioned earlier, when the startup task fails for the packaging project, I see those errors in the event viewer.
EDIT #2: did some more tests with the Desktop Bridge app. It seems that after it fails to start, the Windows event logger gets two more errors listed there for each attempt. One is the error in the "Application Error" category mentioned earlier, and another one is an error in the "AppModel-Runtime" category, with the following info:
Failed with 0x490 modifying AppModel Runtime status for package for user (current status = 0x0, desired status = 0x20).
EDIT #3: as requested, here's the .appxmanifest
file for the packaging project. Note that as mentioned earlier, I tried adding the startup task both using the desktop
namespace as well as the newer uap5
namespace. Again, in both cases I can retrieve the task and prompt the user to enable it, and I do see it listed in the Task Manager, but the application still fails to start with the usual error.
c# uwp windows-10-universal desktop-bridge windows-10-desktop
|
show 2 more comments
NOTE: I've already looked at this related question, this is not a duplicate
I'm working on a UWP app which also uses the Desktop Bridge (the app package contains the UWP app and a WinForms component), and I'm trying to add the auto startup feature, so far without success.
Here's what I did:
Some research. Looked at this question mentioned before, this blog post from MS and at the official docs as well.
Followed the docs by editing the
Package.appxmanifest
file to add theuap5
namespace, and then theuap5:Extension
node as instructed, setting my app .exe file in theExecutable
property, andWindows.FullTrustApplication
in theEntryPoint
property.
Bonus: just in case, I also tried to replace theuap5
namespace withdesktop
, as some code samples used that one instead. Same result, the app doesn't start at all.- Included the APIs to get the startup task and request it to be setup.
- Deployed the app, proceeded to use those APIs, got the confirm window and tapped "allow".
- Opened the Task Managed and double checked that the app name was there under the "Startup" tab, with the "Enabled" label correctly shown next to it.
- Logged out and back in
At this point nothing happens, except from the mouse pointer showing the loading ring for half a second after logging in. Opened the Windows event viewer and found an error, which was indicating the failed auto startup for the app. Tried again a few times and sure enough, every time the app didn't start and another identical error popped up in the event viewer. This is the error info:
Application name: <my app>.exe, versione: 1.0.0.0, timestamp: 0x5a68410c
Module: KERNELBASE.dll, versione: 10.0.17134.407, timestamp: 0x99042cc0
Exception code: 0xe0434352
Offset: 0x000000000003a388
Process ID: 0x1c4c
Path: C:Users<my username>DocumentsGitHub<my app><my app>.Packagebinx64DebugAppX<my app>.exe
Module path: C:WindowsSystem32KERNELBASE.dll
[...]
I'm not sure what I'm doing wrong here, I've followed the docs step by step and I do see the app listed in the Task Manager, but it just fails to start this way.
Any help would be appreciated, thanks in advance! 😄
EDIT: it seems the problem is related to the Desktop Bridge functionality. I have a UWP app and a packaging project, and I've added the startup task to both the .appxmanifest
files (with different Ids). I do this as I use the packaging project to create the x86/x64 builds, and the UWP project directly for the ARM/ARM64 builds.
If I only deploy the UWP app (standalone, without the package) and enable the startup task, the app runs fine. But, if I deploy the packaging project and enable that startup task, the startup fails. I do see the startup task in the Task Manager in both cases. As mentioned earlier, when the startup task fails for the packaging project, I see those errors in the event viewer.
EDIT #2: did some more tests with the Desktop Bridge app. It seems that after it fails to start, the Windows event logger gets two more errors listed there for each attempt. One is the error in the "Application Error" category mentioned earlier, and another one is an error in the "AppModel-Runtime" category, with the following info:
Failed with 0x490 modifying AppModel Runtime status for package for user (current status = 0x0, desired status = 0x20).
EDIT #3: as requested, here's the .appxmanifest
file for the packaging project. Note that as mentioned earlier, I tried adding the startup task both using the desktop
namespace as well as the newer uap5
namespace. Again, in both cases I can retrieve the task and prompt the user to enable it, and I do see it listed in the Task Manager, but the application still fails to start with the usual error.
c# uwp windows-10-universal desktop-bridge windows-10-desktop
Can you include the .net exception? See: stackoverflow.com/a/20358376
– Xiaoy312
Nov 16 '18 at 19:03
@Xiaoy312 Hi, just tried crashing the app again, I'm not seeing any errors in the ".NET Runtime" source unfortunately.
– Sergio0694
Nov 16 '18 at 19:15
Can you share your appxmanifest? Depending on whether you want to start your UWP component or your Winforms component as StartUp Task your will need to author the manifest extension differently.
– Stefan Wick MSFT
Nov 19 '18 at 1:08
@StefanWickMSFT Hi, I've added a new edit to my question with the full code for thePackage.appxmanifest
file, I hope it'll provide useful info. I always want to start the UWP app first, the Win32 component is just a small program I start after app finishes loading using theFullTrustProcessLauncher
APIs. Thanks for your help!
– Sergio0694
Nov 19 '18 at 10:55
The way your manifest is written the StartupTask will attempt to start the Win32 component. If you want to start the UWP you will need to author the extension differently. Look at this doc in the section "UWP App startup task extension" docs.microsoft.com/en-us/uwp/api/…
– Stefan Wick MSFT
Nov 19 '18 at 14:22
|
show 2 more comments
NOTE: I've already looked at this related question, this is not a duplicate
I'm working on a UWP app which also uses the Desktop Bridge (the app package contains the UWP app and a WinForms component), and I'm trying to add the auto startup feature, so far without success.
Here's what I did:
Some research. Looked at this question mentioned before, this blog post from MS and at the official docs as well.
Followed the docs by editing the
Package.appxmanifest
file to add theuap5
namespace, and then theuap5:Extension
node as instructed, setting my app .exe file in theExecutable
property, andWindows.FullTrustApplication
in theEntryPoint
property.
Bonus: just in case, I also tried to replace theuap5
namespace withdesktop
, as some code samples used that one instead. Same result, the app doesn't start at all.- Included the APIs to get the startup task and request it to be setup.
- Deployed the app, proceeded to use those APIs, got the confirm window and tapped "allow".
- Opened the Task Managed and double checked that the app name was there under the "Startup" tab, with the "Enabled" label correctly shown next to it.
- Logged out and back in
At this point nothing happens, except from the mouse pointer showing the loading ring for half a second after logging in. Opened the Windows event viewer and found an error, which was indicating the failed auto startup for the app. Tried again a few times and sure enough, every time the app didn't start and another identical error popped up in the event viewer. This is the error info:
Application name: <my app>.exe, versione: 1.0.0.0, timestamp: 0x5a68410c
Module: KERNELBASE.dll, versione: 10.0.17134.407, timestamp: 0x99042cc0
Exception code: 0xe0434352
Offset: 0x000000000003a388
Process ID: 0x1c4c
Path: C:Users<my username>DocumentsGitHub<my app><my app>.Packagebinx64DebugAppX<my app>.exe
Module path: C:WindowsSystem32KERNELBASE.dll
[...]
I'm not sure what I'm doing wrong here, I've followed the docs step by step and I do see the app listed in the Task Manager, but it just fails to start this way.
Any help would be appreciated, thanks in advance! 😄
EDIT: it seems the problem is related to the Desktop Bridge functionality. I have a UWP app and a packaging project, and I've added the startup task to both the .appxmanifest
files (with different Ids). I do this as I use the packaging project to create the x86/x64 builds, and the UWP project directly for the ARM/ARM64 builds.
If I only deploy the UWP app (standalone, without the package) and enable the startup task, the app runs fine. But, if I deploy the packaging project and enable that startup task, the startup fails. I do see the startup task in the Task Manager in both cases. As mentioned earlier, when the startup task fails for the packaging project, I see those errors in the event viewer.
EDIT #2: did some more tests with the Desktop Bridge app. It seems that after it fails to start, the Windows event logger gets two more errors listed there for each attempt. One is the error in the "Application Error" category mentioned earlier, and another one is an error in the "AppModel-Runtime" category, with the following info:
Failed with 0x490 modifying AppModel Runtime status for package for user (current status = 0x0, desired status = 0x20).
EDIT #3: as requested, here's the .appxmanifest
file for the packaging project. Note that as mentioned earlier, I tried adding the startup task both using the desktop
namespace as well as the newer uap5
namespace. Again, in both cases I can retrieve the task and prompt the user to enable it, and I do see it listed in the Task Manager, but the application still fails to start with the usual error.
c# uwp windows-10-universal desktop-bridge windows-10-desktop
NOTE: I've already looked at this related question, this is not a duplicate
I'm working on a UWP app which also uses the Desktop Bridge (the app package contains the UWP app and a WinForms component), and I'm trying to add the auto startup feature, so far without success.
Here's what I did:
Some research. Looked at this question mentioned before, this blog post from MS and at the official docs as well.
Followed the docs by editing the
Package.appxmanifest
file to add theuap5
namespace, and then theuap5:Extension
node as instructed, setting my app .exe file in theExecutable
property, andWindows.FullTrustApplication
in theEntryPoint
property.
Bonus: just in case, I also tried to replace theuap5
namespace withdesktop
, as some code samples used that one instead. Same result, the app doesn't start at all.- Included the APIs to get the startup task and request it to be setup.
- Deployed the app, proceeded to use those APIs, got the confirm window and tapped "allow".
- Opened the Task Managed and double checked that the app name was there under the "Startup" tab, with the "Enabled" label correctly shown next to it.
- Logged out and back in
At this point nothing happens, except from the mouse pointer showing the loading ring for half a second after logging in. Opened the Windows event viewer and found an error, which was indicating the failed auto startup for the app. Tried again a few times and sure enough, every time the app didn't start and another identical error popped up in the event viewer. This is the error info:
Application name: <my app>.exe, versione: 1.0.0.0, timestamp: 0x5a68410c
Module: KERNELBASE.dll, versione: 10.0.17134.407, timestamp: 0x99042cc0
Exception code: 0xe0434352
Offset: 0x000000000003a388
Process ID: 0x1c4c
Path: C:Users<my username>DocumentsGitHub<my app><my app>.Packagebinx64DebugAppX<my app>.exe
Module path: C:WindowsSystem32KERNELBASE.dll
[...]
I'm not sure what I'm doing wrong here, I've followed the docs step by step and I do see the app listed in the Task Manager, but it just fails to start this way.
Any help would be appreciated, thanks in advance! 😄
EDIT: it seems the problem is related to the Desktop Bridge functionality. I have a UWP app and a packaging project, and I've added the startup task to both the .appxmanifest
files (with different Ids). I do this as I use the packaging project to create the x86/x64 builds, and the UWP project directly for the ARM/ARM64 builds.
If I only deploy the UWP app (standalone, without the package) and enable the startup task, the app runs fine. But, if I deploy the packaging project and enable that startup task, the startup fails. I do see the startup task in the Task Manager in both cases. As mentioned earlier, when the startup task fails for the packaging project, I see those errors in the event viewer.
EDIT #2: did some more tests with the Desktop Bridge app. It seems that after it fails to start, the Windows event logger gets two more errors listed there for each attempt. One is the error in the "Application Error" category mentioned earlier, and another one is an error in the "AppModel-Runtime" category, with the following info:
Failed with 0x490 modifying AppModel Runtime status for package for user (current status = 0x0, desired status = 0x20).
EDIT #3: as requested, here's the .appxmanifest
file for the packaging project. Note that as mentioned earlier, I tried adding the startup task both using the desktop
namespace as well as the newer uap5
namespace. Again, in both cases I can retrieve the task and prompt the user to enable it, and I do see it listed in the Task Manager, but the application still fails to start with the usual error.
c# uwp windows-10-universal desktop-bridge windows-10-desktop
c# uwp windows-10-universal desktop-bridge windows-10-desktop
edited Nov 19 '18 at 10:51
Sergio0694
asked Nov 16 '18 at 18:57
Sergio0694Sergio0694
1,99211434
1,99211434
Can you include the .net exception? See: stackoverflow.com/a/20358376
– Xiaoy312
Nov 16 '18 at 19:03
@Xiaoy312 Hi, just tried crashing the app again, I'm not seeing any errors in the ".NET Runtime" source unfortunately.
– Sergio0694
Nov 16 '18 at 19:15
Can you share your appxmanifest? Depending on whether you want to start your UWP component or your Winforms component as StartUp Task your will need to author the manifest extension differently.
– Stefan Wick MSFT
Nov 19 '18 at 1:08
@StefanWickMSFT Hi, I've added a new edit to my question with the full code for thePackage.appxmanifest
file, I hope it'll provide useful info. I always want to start the UWP app first, the Win32 component is just a small program I start after app finishes loading using theFullTrustProcessLauncher
APIs. Thanks for your help!
– Sergio0694
Nov 19 '18 at 10:55
The way your manifest is written the StartupTask will attempt to start the Win32 component. If you want to start the UWP you will need to author the extension differently. Look at this doc in the section "UWP App startup task extension" docs.microsoft.com/en-us/uwp/api/…
– Stefan Wick MSFT
Nov 19 '18 at 14:22
|
show 2 more comments
Can you include the .net exception? See: stackoverflow.com/a/20358376
– Xiaoy312
Nov 16 '18 at 19:03
@Xiaoy312 Hi, just tried crashing the app again, I'm not seeing any errors in the ".NET Runtime" source unfortunately.
– Sergio0694
Nov 16 '18 at 19:15
Can you share your appxmanifest? Depending on whether you want to start your UWP component or your Winforms component as StartUp Task your will need to author the manifest extension differently.
– Stefan Wick MSFT
Nov 19 '18 at 1:08
@StefanWickMSFT Hi, I've added a new edit to my question with the full code for thePackage.appxmanifest
file, I hope it'll provide useful info. I always want to start the UWP app first, the Win32 component is just a small program I start after app finishes loading using theFullTrustProcessLauncher
APIs. Thanks for your help!
– Sergio0694
Nov 19 '18 at 10:55
The way your manifest is written the StartupTask will attempt to start the Win32 component. If you want to start the UWP you will need to author the extension differently. Look at this doc in the section "UWP App startup task extension" docs.microsoft.com/en-us/uwp/api/…
– Stefan Wick MSFT
Nov 19 '18 at 14:22
Can you include the .net exception? See: stackoverflow.com/a/20358376
– Xiaoy312
Nov 16 '18 at 19:03
Can you include the .net exception? See: stackoverflow.com/a/20358376
– Xiaoy312
Nov 16 '18 at 19:03
@Xiaoy312 Hi, just tried crashing the app again, I'm not seeing any errors in the ".NET Runtime" source unfortunately.
– Sergio0694
Nov 16 '18 at 19:15
@Xiaoy312 Hi, just tried crashing the app again, I'm not seeing any errors in the ".NET Runtime" source unfortunately.
– Sergio0694
Nov 16 '18 at 19:15
Can you share your appxmanifest? Depending on whether you want to start your UWP component or your Winforms component as StartUp Task your will need to author the manifest extension differently.
– Stefan Wick MSFT
Nov 19 '18 at 1:08
Can you share your appxmanifest? Depending on whether you want to start your UWP component or your Winforms component as StartUp Task your will need to author the manifest extension differently.
– Stefan Wick MSFT
Nov 19 '18 at 1:08
@StefanWickMSFT Hi, I've added a new edit to my question with the full code for the
Package.appxmanifest
file, I hope it'll provide useful info. I always want to start the UWP app first, the Win32 component is just a small program I start after app finishes loading using the FullTrustProcessLauncher
APIs. Thanks for your help!– Sergio0694
Nov 19 '18 at 10:55
@StefanWickMSFT Hi, I've added a new edit to my question with the full code for the
Package.appxmanifest
file, I hope it'll provide useful info. I always want to start the UWP app first, the Win32 component is just a small program I start after app finishes loading using the FullTrustProcessLauncher
APIs. Thanks for your help!– Sergio0694
Nov 19 '18 at 10:55
The way your manifest is written the StartupTask will attempt to start the Win32 component. If you want to start the UWP you will need to author the extension differently. Look at this doc in the section "UWP App startup task extension" docs.microsoft.com/en-us/uwp/api/…
– Stefan Wick MSFT
Nov 19 '18 at 14:22
The way your manifest is written the StartupTask will attempt to start the Win32 component. If you want to start the UWP you will need to author the extension differently. Look at this doc in the section "UWP App startup task extension" docs.microsoft.com/en-us/uwp/api/…
– Stefan Wick MSFT
Nov 19 '18 at 14:22
|
show 2 more comments
1 Answer
1
active
oldest
votes
When setting up a StartupTask extension in your appxmanifest it is important to understand that the declaration is different for Win32 components vs UWP components. This is documented here:
https://docs.microsoft.com/en-us/uwp/api/Windows.ApplicationModel.StartupTask
UWP Components:
<Package xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" ...>
...
<Applications>
<Application ...>
...
<Extensions>
<uap5:Extension Category="windows.startupTask">
<uap5:StartupTask
TaskId="MyStartupId"
Enabled="false"
DisplayName="Test startup" />
</uap5:Extension>
</Extensions>
</Application>
</Applications>
Win32 Components:
<Package xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"...>
...
<Applications>
<Application ...>
...
<Extensions>
<uap5:Extension
Category="windows.startupTask"
Executable="MyDesktopBridgeApp.exe"
EntryPoint="Windows.FullTrustApplication">
<uap5:StartupTask
TaskId="MyStartupId"
Enabled="false"
DisplayName="My Desktop Bridge App" />
</uap5:Extension>
</Extensions>
</Application>
</Applications>
Thanks again! This worked fine to start the UWP app, which then in turns starts the Win32 program by itself with theFullTrustProcessLauncher
API, as mentioned earlier. I do want to suggest though that it might be a good idea to expand the docs a bit and maybe add a couple notes about packaged UWP apps like in this case. Currently, the docs only make the distinction between "standalone" UWP and Bridge apps, so the right location for the task declaration wasn't really clear. I get that the Desktop Bridge is primarily meant to be used the other way around (Win32 to UWP), but still.
– Sergio0694
Nov 19 '18 at 17:15
1
Good feedback - in general our docs today don't cover "mixed" packages very well that contain both UWP and Win32 components. FYI - our docs also have the option at the bottom to submit direct feedback on the respective topic. Thanks!
– Stefan Wick MSFT
Nov 19 '18 at 17:18
Yeah I've already opened a direct feedback on thatStartupTask
docs page a couple days ago, happy to help! 😄
– Sergio0694
Nov 19 '18 at 17:50
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53343852%2fuwp-app-fails-to-start-on-login-using-the-startuptask-apis%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
When setting up a StartupTask extension in your appxmanifest it is important to understand that the declaration is different for Win32 components vs UWP components. This is documented here:
https://docs.microsoft.com/en-us/uwp/api/Windows.ApplicationModel.StartupTask
UWP Components:
<Package xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" ...>
...
<Applications>
<Application ...>
...
<Extensions>
<uap5:Extension Category="windows.startupTask">
<uap5:StartupTask
TaskId="MyStartupId"
Enabled="false"
DisplayName="Test startup" />
</uap5:Extension>
</Extensions>
</Application>
</Applications>
Win32 Components:
<Package xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"...>
...
<Applications>
<Application ...>
...
<Extensions>
<uap5:Extension
Category="windows.startupTask"
Executable="MyDesktopBridgeApp.exe"
EntryPoint="Windows.FullTrustApplication">
<uap5:StartupTask
TaskId="MyStartupId"
Enabled="false"
DisplayName="My Desktop Bridge App" />
</uap5:Extension>
</Extensions>
</Application>
</Applications>
Thanks again! This worked fine to start the UWP app, which then in turns starts the Win32 program by itself with theFullTrustProcessLauncher
API, as mentioned earlier. I do want to suggest though that it might be a good idea to expand the docs a bit and maybe add a couple notes about packaged UWP apps like in this case. Currently, the docs only make the distinction between "standalone" UWP and Bridge apps, so the right location for the task declaration wasn't really clear. I get that the Desktop Bridge is primarily meant to be used the other way around (Win32 to UWP), but still.
– Sergio0694
Nov 19 '18 at 17:15
1
Good feedback - in general our docs today don't cover "mixed" packages very well that contain both UWP and Win32 components. FYI - our docs also have the option at the bottom to submit direct feedback on the respective topic. Thanks!
– Stefan Wick MSFT
Nov 19 '18 at 17:18
Yeah I've already opened a direct feedback on thatStartupTask
docs page a couple days ago, happy to help! 😄
– Sergio0694
Nov 19 '18 at 17:50
add a comment |
When setting up a StartupTask extension in your appxmanifest it is important to understand that the declaration is different for Win32 components vs UWP components. This is documented here:
https://docs.microsoft.com/en-us/uwp/api/Windows.ApplicationModel.StartupTask
UWP Components:
<Package xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" ...>
...
<Applications>
<Application ...>
...
<Extensions>
<uap5:Extension Category="windows.startupTask">
<uap5:StartupTask
TaskId="MyStartupId"
Enabled="false"
DisplayName="Test startup" />
</uap5:Extension>
</Extensions>
</Application>
</Applications>
Win32 Components:
<Package xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"...>
...
<Applications>
<Application ...>
...
<Extensions>
<uap5:Extension
Category="windows.startupTask"
Executable="MyDesktopBridgeApp.exe"
EntryPoint="Windows.FullTrustApplication">
<uap5:StartupTask
TaskId="MyStartupId"
Enabled="false"
DisplayName="My Desktop Bridge App" />
</uap5:Extension>
</Extensions>
</Application>
</Applications>
Thanks again! This worked fine to start the UWP app, which then in turns starts the Win32 program by itself with theFullTrustProcessLauncher
API, as mentioned earlier. I do want to suggest though that it might be a good idea to expand the docs a bit and maybe add a couple notes about packaged UWP apps like in this case. Currently, the docs only make the distinction between "standalone" UWP and Bridge apps, so the right location for the task declaration wasn't really clear. I get that the Desktop Bridge is primarily meant to be used the other way around (Win32 to UWP), but still.
– Sergio0694
Nov 19 '18 at 17:15
1
Good feedback - in general our docs today don't cover "mixed" packages very well that contain both UWP and Win32 components. FYI - our docs also have the option at the bottom to submit direct feedback on the respective topic. Thanks!
– Stefan Wick MSFT
Nov 19 '18 at 17:18
Yeah I've already opened a direct feedback on thatStartupTask
docs page a couple days ago, happy to help! 😄
– Sergio0694
Nov 19 '18 at 17:50
add a comment |
When setting up a StartupTask extension in your appxmanifest it is important to understand that the declaration is different for Win32 components vs UWP components. This is documented here:
https://docs.microsoft.com/en-us/uwp/api/Windows.ApplicationModel.StartupTask
UWP Components:
<Package xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" ...>
...
<Applications>
<Application ...>
...
<Extensions>
<uap5:Extension Category="windows.startupTask">
<uap5:StartupTask
TaskId="MyStartupId"
Enabled="false"
DisplayName="Test startup" />
</uap5:Extension>
</Extensions>
</Application>
</Applications>
Win32 Components:
<Package xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"...>
...
<Applications>
<Application ...>
...
<Extensions>
<uap5:Extension
Category="windows.startupTask"
Executable="MyDesktopBridgeApp.exe"
EntryPoint="Windows.FullTrustApplication">
<uap5:StartupTask
TaskId="MyStartupId"
Enabled="false"
DisplayName="My Desktop Bridge App" />
</uap5:Extension>
</Extensions>
</Application>
</Applications>
When setting up a StartupTask extension in your appxmanifest it is important to understand that the declaration is different for Win32 components vs UWP components. This is documented here:
https://docs.microsoft.com/en-us/uwp/api/Windows.ApplicationModel.StartupTask
UWP Components:
<Package xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" ...>
...
<Applications>
<Application ...>
...
<Extensions>
<uap5:Extension Category="windows.startupTask">
<uap5:StartupTask
TaskId="MyStartupId"
Enabled="false"
DisplayName="Test startup" />
</uap5:Extension>
</Extensions>
</Application>
</Applications>
Win32 Components:
<Package xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"...>
...
<Applications>
<Application ...>
...
<Extensions>
<uap5:Extension
Category="windows.startupTask"
Executable="MyDesktopBridgeApp.exe"
EntryPoint="Windows.FullTrustApplication">
<uap5:StartupTask
TaskId="MyStartupId"
Enabled="false"
DisplayName="My Desktop Bridge App" />
</uap5:Extension>
</Extensions>
</Application>
</Applications>
answered Nov 19 '18 at 17:00
Stefan Wick MSFTStefan Wick MSFT
9,64811938
9,64811938
Thanks again! This worked fine to start the UWP app, which then in turns starts the Win32 program by itself with theFullTrustProcessLauncher
API, as mentioned earlier. I do want to suggest though that it might be a good idea to expand the docs a bit and maybe add a couple notes about packaged UWP apps like in this case. Currently, the docs only make the distinction between "standalone" UWP and Bridge apps, so the right location for the task declaration wasn't really clear. I get that the Desktop Bridge is primarily meant to be used the other way around (Win32 to UWP), but still.
– Sergio0694
Nov 19 '18 at 17:15
1
Good feedback - in general our docs today don't cover "mixed" packages very well that contain both UWP and Win32 components. FYI - our docs also have the option at the bottom to submit direct feedback on the respective topic. Thanks!
– Stefan Wick MSFT
Nov 19 '18 at 17:18
Yeah I've already opened a direct feedback on thatStartupTask
docs page a couple days ago, happy to help! 😄
– Sergio0694
Nov 19 '18 at 17:50
add a comment |
Thanks again! This worked fine to start the UWP app, which then in turns starts the Win32 program by itself with theFullTrustProcessLauncher
API, as mentioned earlier. I do want to suggest though that it might be a good idea to expand the docs a bit and maybe add a couple notes about packaged UWP apps like in this case. Currently, the docs only make the distinction between "standalone" UWP and Bridge apps, so the right location for the task declaration wasn't really clear. I get that the Desktop Bridge is primarily meant to be used the other way around (Win32 to UWP), but still.
– Sergio0694
Nov 19 '18 at 17:15
1
Good feedback - in general our docs today don't cover "mixed" packages very well that contain both UWP and Win32 components. FYI - our docs also have the option at the bottom to submit direct feedback on the respective topic. Thanks!
– Stefan Wick MSFT
Nov 19 '18 at 17:18
Yeah I've already opened a direct feedback on thatStartupTask
docs page a couple days ago, happy to help! 😄
– Sergio0694
Nov 19 '18 at 17:50
Thanks again! This worked fine to start the UWP app, which then in turns starts the Win32 program by itself with the
FullTrustProcessLauncher
API, as mentioned earlier. I do want to suggest though that it might be a good idea to expand the docs a bit and maybe add a couple notes about packaged UWP apps like in this case. Currently, the docs only make the distinction between "standalone" UWP and Bridge apps, so the right location for the task declaration wasn't really clear. I get that the Desktop Bridge is primarily meant to be used the other way around (Win32 to UWP), but still.– Sergio0694
Nov 19 '18 at 17:15
Thanks again! This worked fine to start the UWP app, which then in turns starts the Win32 program by itself with the
FullTrustProcessLauncher
API, as mentioned earlier. I do want to suggest though that it might be a good idea to expand the docs a bit and maybe add a couple notes about packaged UWP apps like in this case. Currently, the docs only make the distinction between "standalone" UWP and Bridge apps, so the right location for the task declaration wasn't really clear. I get that the Desktop Bridge is primarily meant to be used the other way around (Win32 to UWP), but still.– Sergio0694
Nov 19 '18 at 17:15
1
1
Good feedback - in general our docs today don't cover "mixed" packages very well that contain both UWP and Win32 components. FYI - our docs also have the option at the bottom to submit direct feedback on the respective topic. Thanks!
– Stefan Wick MSFT
Nov 19 '18 at 17:18
Good feedback - in general our docs today don't cover "mixed" packages very well that contain both UWP and Win32 components. FYI - our docs also have the option at the bottom to submit direct feedback on the respective topic. Thanks!
– Stefan Wick MSFT
Nov 19 '18 at 17:18
Yeah I've already opened a direct feedback on that
StartupTask
docs page a couple days ago, happy to help! 😄– Sergio0694
Nov 19 '18 at 17:50
Yeah I've already opened a direct feedback on that
StartupTask
docs page a couple days ago, happy to help! 😄– Sergio0694
Nov 19 '18 at 17:50
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53343852%2fuwp-app-fails-to-start-on-login-using-the-startuptask-apis%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you include the .net exception? See: stackoverflow.com/a/20358376
– Xiaoy312
Nov 16 '18 at 19:03
@Xiaoy312 Hi, just tried crashing the app again, I'm not seeing any errors in the ".NET Runtime" source unfortunately.
– Sergio0694
Nov 16 '18 at 19:15
Can you share your appxmanifest? Depending on whether you want to start your UWP component or your Winforms component as StartUp Task your will need to author the manifest extension differently.
– Stefan Wick MSFT
Nov 19 '18 at 1:08
@StefanWickMSFT Hi, I've added a new edit to my question with the full code for the
Package.appxmanifest
file, I hope it'll provide useful info. I always want to start the UWP app first, the Win32 component is just a small program I start after app finishes loading using theFullTrustProcessLauncher
APIs. Thanks for your help!– Sergio0694
Nov 19 '18 at 10:55
The way your manifest is written the StartupTask will attempt to start the Win32 component. If you want to start the UWP you will need to author the extension differently. Look at this doc in the section "UWP App startup task extension" docs.microsoft.com/en-us/uwp/api/…
– Stefan Wick MSFT
Nov 19 '18 at 14:22