none
[UWP] Crash after Opt-in for Multiple Instances RRS feed

  • Question

  • I have a UWP application project built with VS2017 15.7.3

    the app targeting is:

    Target version: Windows 10, version 1803 

    Min version: Windows 10 Creators Update 

    To opt-in for multiple instances support, 

    1:

    add desktop4:SupportsMultipleInstances="true" in "package.appxmanifest"


    2: add conditional compilation symbol DISABLE_XAML_GENERATED_MAIN

    and added a test Program.cs with the following code

    static void Main(string[] args)
    {
    
               
         var activatedArgs = AppInstance.GetActivatedEventArgs();
                
         Application.Start((p) => new App());
    }
    everything compiles correctly.

    However the app crashes before it ever reaches Main.

    From the event viewer, I got this error

    Activation for 5d40a47e-385b-495e-9232-b715cf6fd008_4fddxyvsdr1hc!App failed. Error code: The app didn't start.. Activation phase: COM ActivateExtension

    If I upgrade the min targeting version to be version 1803, everything seems fine.

    Is the crash normal?

    and 

    how to opt-in multiple instances for my app on windows 10, 1803 runtime while staying compactible with lower windows 10 versions?



    • Edited by hereafter Wednesday, June 13, 2018 12:52 AM
    Tuesday, June 12, 2018 6:29 AM

Answers

  • @hereafter,

    See the doc here:

    https://docs.microsoft.com/en-us/windows/uwp/debug-test-perf/version-adaptive-code

    "You must increase your app's Minimum Version if you use:

    a new API that requires a capability that isn't available in an earlier version. You must increase the minimum supported version to one that includes that capability. For more info, see App capability declarations."

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Hereafter2 Friday, June 15, 2018 3:04 AM
    • Marked as answer by hereafter Friday, June 15, 2018 3:08 AM
    Thursday, June 14, 2018 8:54 AM
    Moderator

All replies

  • Hello,

    Please read the sticky posts, especially the Guide to posting: subject line tags , and don't forget add tag to your question.

    Why your min version is 1703. You are using features from 1803. Change min version to 1803 and all will work.


    Make the community better together

    Tuesday, June 12, 2018 8:15 PM
  • That is min version is designed for, so a binary package could light up "new features" on newer version of Windows 10 while compatible with older ones.
    Wednesday, June 13, 2018 12:52 AM
  •  so a binary package could light up "new features" on newer version of Windows 10 while compatible with older ones.
    But not for MultipleInstances and some other features  which is declared in Manifest file. 

    Make the community better together

    • Marked as answer by hereafter Wednesday, June 13, 2018 7:35 AM
    • Unmarked as answer by hereafter Wednesday, June 13, 2018 7:36 AM
    Wednesday, June 13, 2018 7:34 AM
  • in another word, in order to use these new features, the binary must stop working on lower versions?

    Could any staff from Microsoft please confirm this?

    Wednesday, June 13, 2018 7:37 AM
  • @hereafter,

    See the doc here:

    https://docs.microsoft.com/en-us/windows/uwp/debug-test-perf/version-adaptive-code

    "You must increase your app's Minimum Version if you use:

    a new API that requires a capability that isn't available in an earlier version. You must increase the minimum supported version to one that includes that capability. For more info, see App capability declarations."

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Hereafter2 Friday, June 15, 2018 3:04 AM
    • Marked as answer by hereafter Friday, June 15, 2018 3:08 AM
    Thursday, June 14, 2018 8:54 AM
    Moderator