Search code examples
c#windows-store-appswin-universal-appuwpwindows-10-mobile

CurrentAppSimulator ignored on Windows 10 Mobile


When debugging a UWP app on a PC, we use CurrentAppSimulator.LicenseInformation returns the contents of WindowsStoreProxy.xml, so we can test different cases. When connecting a Windows 10 Mobile phone - WindowsStoreProxy.xml is ignored.

Why / What's the solution?


Solution

  • You can add WindowsStoreProxy.xml to your solution and load it at run time. I remember I added the File to my solution and then loaded it during run time. Check ReloadSimulatorAsync from here


    Update: For anyone who wants to know how to do this, Below is the code.

    Add this to your MainPage.xaml.cs

    public static async Task TestSimulator()
    {
        var proxyFile = await Package.Current.InstalledLocation.GetFileAsync(@"WindowsStoreProxy.xml");
        await CurrentAppSimulator.ReloadSimulatorAsync(proxyFile);
    }
    

    and Call this method on OnNavigatedTo

    await MainPage.TestSimulator();
    

    Note: For some reason, this code did not work for me when i added this in App.xaml.cs so i used it in MainPage.xaml.cs