ispiro ispiro - 6 months ago 77
C# Question

CurrentAppSimulator ignored on Windows 10 Mobile

When debugging a UWP app on a PC, we use

returns the contents of
, so we can test different cases. When connecting a Windows 10 Mobile phone -
is ignored.

Why / What's the 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