none
[UWP]Application won't run without internet for some users RRS feed

  • Question

  • Some of the users of my UWP application MobileSheets are encountering a problem where the application won't run without internet access. If they run the application with internet once, all subsequent loads of the software work until they reboot their machine, and then it again won't work if internet access if not available. With the Anniversary Update, the application would show the splash screen, then instantly close. With the creator's update, it's now displaying the message shown in the image I have included with this post.  Nothing in my application shows that message or would close the application without internet access, so I can only assume this has something to do with either Windows 10 or the Microsoft Store and UWP apps. I cannot reproduce this error myself on any machine I've tested on, furthering my belief that is has nothing to with my application code.  The only known fix that has worked for my users is to reset Windows 10, but that is not something users want to hear, as it's a huge headache. Is there something that can be done about this issue? Is there some setting I'm unaware for UWP applications that I can change, or is there something in code I can do to prevent this behavior? It's becoming a major issue for my users as my application is designed for musicians that often don't have access to the internet at the venues they are performing at.

    Thanks,

    Mike



    • Edited by Michael Zuber Wednesday, May 31, 2017 6:33 PM Clarifications/wording
    • Edited by Xavier Xie-MSFT Friday, June 2, 2017 1:30 AM add title tag
    Wednesday, May 31, 2017 6:21 PM

All replies

  • Hi Michael Zuber,

    >> Application won't run without internet for some users?

    According to your description, this issue only occurred when the users don’t have internet access and you can’t reproduce it on any machine. So I have some questions about it:

    1.        When you were testing this issue, are you in an environment without internet access?
    2.        Could you tell me about what you have done when app is starting? Are there some actions that needs internet access?
    3.        Could you tell me about your OS version and your project's target version?

    Best Regards,

    Xavier Eoro


    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.


    Friday, June 2, 2017 1:32 AM
  • Hello Xavier,

    1) I can't reproduce this behavior myself, but some of my users can easily reproduce it.  The only thing they have to do is restart Windows 10 with their internet disabled, then run my app and it will either close instantly (with the Anniversary Update) or show the error included with the screenshot (with the Creator's Update). Users have frequently contacted me after traveling to a location without internet access and finding they can't run the application at all (which has caused major problems with their performances or practices).

    2) For a long time, I didn't disable Prelaunch, but in a recent update, I decided to not allow that anymore to see if it would help with the issue. So in my OnLaunched method, I have the following:

                if (e.PrelaunchActivated)
                {
                    return;
                }
                HockeyClient.Current.Configure(HOCKEYAPP_ID);
                if (e != null)
                {
                    CommonInit(e.PreviousExecutionState, e.Arguments);
                }
                else
                {
                    CommonInit(ApplicationExecutionState.Running, null);
                }
    The CommonInit method is basically some pretty standard initialization code, as follows:

    private async void CommonInit(ApplicationExecutionState prevState, object arguments) { Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); rootFrame.Navigated += OnNavigated;

    if (prevState == ApplicationExecutionState.Terminated)
            {
                try
                {
                    await SuspensionManager.RestoreAsync();
                    LoadSavedState();
                }
                catch (Exception) { }
            }

    // Place the frame in the current Window Window.Current.Content = rootFrame; }

    bool firstTime = rootFrame.Content == null; if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter rootFrame.Navigate(typeof(MainPage), arguments); } else if (arguments != null && arguments is IReadOnlyList<IStorageItem>) { var mainPage = rootFrame.Content as MainPage; if (mainPage != null) { try { await mainPage.HandleArgument((IReadOnlyList<IStorageItem>)arguments); } catch (Exception ex) { ExceptionHandler.HandleException(ex); } } } // Ensure the current window is active Window.Current.Activate();

    if (firstTime)
        {
            Task t = Task.Run(async () =>
            {
                try
                {
                    await ClearOldCacheFiles();
                }
                catch (Exception ex)
                {
                    ExceptionHandler.HandleException(ex);
                }
            });
        }

    }

    3) I'm running OS Version 1703 and OS Build 15063.296 (the Creator's Update).  My application Target Version is Windows 10 Creators Update (10.0; Build 15063) and the Min version is Windows 10 Anniversary Update (10.0; Build 14393). The same problem was present when I was targeting the Anniversary Update.

    Thanks,

    Mike



    Friday, June 2, 2017 2:52 AM
  • One of my users had this issue  in Airplane mode too, he had Windows 10 Mobile with Anniversary Update. I do not use HockeyApp, prelaunch was (and it still is) disabled.

    Saturday, June 3, 2017 12:36 PM
  • Hi Michael Zuber,

    Thank you for your replay.

    After looking through your code, I found there are several asynchronous methods in your OnLaunched method. Without the detail information of these methods, I don’t know if one or more of them need internet connection which may curses the crash of the app.

    HockeyClient can save the crash report of your app even there is no internet connection after config and upload the report if the network is available. Could you share the crash report with me?

    And another thing that I’m going to mention you is that the OnLaunched method should be finished in a few seconds or the system may think your app is unresponsive and terminate it. This is mentioned in the penultimate paragraph of the app launch part in the Windows 10 universal Windows platform (UWP) app lifecycle. So please make sure what you do in the OnLaunched method will finish quickly.

    At last, I have many more questions about this issue:

    1.        Is the app side loaded or store deployed?
    2.        Are there entries in the event log?
    3.        Do you have any initializing on code that may hit the internet on his behalf (e.g. Advertising)?

    Best Regards,

    Xavier Eoro


    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.

    Monday, June 5, 2017 7:15 AM
  • None of the asynchronous methods listed perform any actions that require an internet connection. It's all code that is internal to my application that doesn't rely on any external components.  As mentioned before, nothing in my application pops up that kind of dialog with that message. 

    As for HockeyApp, I'm not receiving any crash reports related to this issue because the application is not crashing. It's either immediately closing or never launching in the first place.  As I described in my previous post, in the creator's update, it just displays the above message without ever displaying any part of my application.  

    My OnLaunched method does finish quickly - there are no problems there.  Even if the application was terminated as a result of that method taking too long, why would Windows randomly show a dialog indicating that internet is required? And why would the problem disappear when WiFi is present when none of the code I'm executing in relation to that OnLaunched function requires internet for anything? My application is specifically designed not to require WiFi, as most musicians won't have internet access.  So having anything in the application that requires internet for normal performances would be unacceptable. The only parts of my application that make use of an internet connection are imports from Dropbox or Google Drive, which are only things that occur after the user explicitly accesses those features (not something that would happen when you just launch the app or load a song to view a file). 

    1) The app is store deployed. 

    2) I can ask one of my affected users to provide that information if you think it will be useful.

    3) No, my application does not access the internet during initialization for any reason, and I don't have advertising (it is a paid app).  The only things which in theory could use internet are HockeyApp and the license check API I suppose. I'm using StoreContext GetAppLicenseAsync to get the license information, but I only do this after the UI is displayed and fully initialized, and my users aren't seeing the UI load at all, so I don't believe that's related in any way.

    Thanks,
    Mike


    Monday, June 5, 2017 8:02 AM
  • @ Michael Zuber

    >>” I can ask one of my affected users to provide that information if you think it will be useful.”

    If you could provide event log, it would be better. Thank you.

    Best Regards,

    Xavier Eoro


    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.

    Tuesday, June 6, 2017 5:41 AM
  • Hi Michael Zuber,

    Do you have any update information?

    Could you answer some question about your App?

    1.Could you tell me the OS version that the affected users are using? We need more information about it.

    2.Could you tell me about your app’s name? It important because I want to test your app directly

    Please help me complete these information and I trying to work out it.

    Best Regards,

    Xavier Eoro


    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.

    Wednesday, June 7, 2017 2:03 AM
  • Here is the event log entry my user provided:

    Protokollname: Application

    Quelle:        Microsoft-Windows-Immersive-Shell
    Datum:         06.06.2017 23:12:35
    Ereignis-ID:   5973
    Aufgabenkategorie: (5973)
    Ebene:         Fehler
    Schlüsselwörter:
    Benutzer:      HEINZ02\Heinz
    Computer:      HEINZ02
    Beschreibung:
    Bei der Aktivierung der App „41730Zubersoft.MobileSheets_ys1c8ct2g6ypr!App“ ist folgender Fehler aufgetreten: Unknown HResult Error code: 0x803f9008. Weitere Informationen finden Sie im Protokoll „Microsoft-Windows-TWinUI/Betriebsbereit“.
    Ereignis-XML:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Microsoft-Windows-Immersive-Shell" Guid="{315A8872-923E-4EA2-9889-33CD4754BF64}" />
        <EventID>5973</EventID>
        <Version>0</Version>
        <Level>2</Level>
        <Task>5973</Task>
        <Opcode>0</Opcode>
        <Keywords>0x2000000000000000</Keywords>
        <TimeCreated SystemTime="2017-06-06T21:12:35.347478800Z" />
        <EventRecordID>12476</EventRecordID>
        <Correlation />
        <Execution ProcessID="7536" ThreadID="8212" />
        <Channel>Application</Channel>
        <Computer>HEINZ02</Computer>
        <Security UserID="S-1-5-21-1580283753-2979410392-3844040679-1001" />
      </System>
      <EventData>
        <Data Name="AppId">41730Zubersoft.MobileSheets_ys1c8ct2g6ypr!App</Data>
        <Data Name="ErrorCode">-2143318008</Data>
      </EventData>
    </Event>

    As for your questions:

    1) The users are running version 1607 (the anniversary update) and 1703 (the creator's update).  If you need specific OS build numbers, I would have to request that information from my users.

    2) The app is named MobileSheets and is available on the Microsoft store here: https://www.microsoft.com/en-us/store/p/mobilesheets/9nblggh6ct6d

    Thanks,
    Mike

    Wednesday, June 7, 2017 7:20 AM
  • Hi Michael Zuber,

    After having a look at the event log, I found that “Microsoft-Windows-Immersive-Shell” was the reason why your app couldn’t launch. It is a part of the windows system and it means Registry or file system permissions may have been changed from their defaults.  That’s why when some users met the problem, they can solve it by resetting Windows 10.

    As a result, this question is out of the scope for our forum, And if it is very emergency for you, I suggest you to open a Support Ticket for help.

    Best Regards,

    Xavier Eoro


    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.

    Friday, June 9, 2017 3:24 AM
  • Thank you for your answers Xavier.  It seems as though you are telling me there is nothing I can do in my application to avoid this problem, as it's a problem with the Windows 10 registry or file permissions. How would opening a support ticket help with that problem then? It seems like this is a problem with Windows 10 then and is not something that application developers should be forced to deal with.  Also, why are some users only encountering this problem with my store app and not other store apps if it's related to the registry or file system permissions?  What am I supposed to instruct my users to do? Is resetting Windows 10 the only answer? If so, that seems like a poor response to this problem, and will cause many users who were considering using Windows 10 to run my app to go right back to Android.  I hope Microsoft has a better response to dealing with this problem than that, as I'm getting a lot of users reporting this problem.

    Thanks,

    Mike

    Friday, June 9, 2017 8:32 AM
  • I added logging into my application to see if it was actually being loaded, and I've verified that none of my code is being executed at startup when this problem occurs on users' machines. That means it's a problem strictly with Windows 10. Surely someone from Microsoft can provide guidance on what can be done if a user encounters this error.  Having to tell my users to reset Windows 10 is ridiculous. You don't see Google or Apple telling users, "Hey sorry this app didn't work, just do a factory reset on your device so you can run it." Having to pay for a support ticket for something that is NOT a problem with my application, and is instead a problem with Windows 10, doesn't make any sense, especially considering how many users are contacting me about this issue (and leaving bad store reviews because of it).  If you want to continue eroding users trust in Windows 10 and the Microsoft Store, and want to continue pushing people to other OS's, by all means ignore this issue and allow more of my users to be come dissatisfied customers.

    Thanks,
    Mike

    Wednesday, June 21, 2017 8:30 PM