1

I want to run my packaged c# app to start at log-in. Under the guidance of this post, I configured Package.appxmanifest and added relevant code to my app. However, when users log in, the splash screen appears but then the application fails to launch.

The post mentions one thing:

If your app is enabled for startup activation, you should handle this case in your App class by overriding the OnActivated method.

However, WASDK app doesn't have an OnActivated method. I guess the problem lies here and I wonder how to correctly configure my code to fix this issue.

Appreciate any help.

Frank
  • 136
  • 1
  • 10

1 Answers1

1

Resolved.
According to this blog, we are supposed to write package.appxmanifest in this form:

<Extensions>
    <uap5:Extension
    Category="windows.startupTask"
    Executable="SingleInstancedError.exe"
    EntryPoint="SingleInstancedError.App">
        <uap5:StartupTask
        TaskId="SingleInstancedErrorId"
        Enabled="false"
        DisplayName="SingleInstancedError startup" />
    </uap5:Extension>
</Extensions>

However, to make it work for Windows App SDK, these two lines must be removed:

Executable="SingleInstancedError.exe"
EntryPoint="SingleInstancedError.App"

So that the manifest looks like this:

<Extensions>
    <uap5:Extension
    Category="windows.startupTask">
        <uap5:StartupTask
        TaskId="SingleInstancedErrorId"
        Enabled="false"
        DisplayName="SingleInstancedError startup" />
    </uap5:Extension>
</Extensions>

And the app runs normally at startup.

Frank
  • 136
  • 1
  • 10