diff --git a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.UWP/App.xaml.cs b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.UWP/App.xaml.cs index 9dfa6eec3..17aa619c9 100644 --- a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.UWP/App.xaml.cs +++ b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.UWP/App.xaml.cs @@ -1,15 +1,13 @@ using System; using System.Diagnostics; -using System.Globalization; -using System.Threading.Tasks; +using Microsoft.AppCenter; +using Microsoft.AppCenter.Push; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; +using Windows.Globalization; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Navigation; -using Microsoft.AppCenter; -using Microsoft.AppCenter.Analytics; -using Microsoft.AppCenter.Push; namespace Contoso.Forms.Demo.UWP { @@ -28,7 +26,8 @@ namespace Contoso.Forms.Demo.UWP // Note that the country code provided does not reflect the physical device location, but rather the // country that corresponds to the culture it uses. You may wish to retrieve the country code using // a different means, such as device location. - AppCenter.SetCountryCode(RegionInfo.CurrentRegion.TwoLetterISORegionName); + var geographicRegion = new GeographicRegion(); + AppCenter.SetCountryCode(geographicRegion.CodeTwoLetter); InitializeComponent(); Suspending += OnSuspending; } diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/App.xaml.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/App.xaml.cs index 1b2ed3cbb..5635d04ee 100644 --- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/App.xaml.cs +++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/App.xaml.cs @@ -1,13 +1,13 @@ using System; using System.Diagnostics; -using System.Globalization; using Microsoft.AppCenter; +using Microsoft.AppCenter.Push; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; +using Windows.Globalization; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Navigation; -using Microsoft.AppCenter.Push; namespace Contoso.Forms.Puppet.UWP { @@ -26,7 +26,8 @@ namespace Contoso.Forms.Puppet.UWP // Note that the country code provided does not reflect the physical device location, but rather the // country that corresponds to the culture it uses. You may wish to retrieve the country code using // a different means, such as device location. - AppCenter.SetCountryCode(RegionInfo.CurrentRegion.TwoLetterISORegionName); + var geographicRegion = new GeographicRegion(); + AppCenter.SetCountryCode(geographicRegion.CodeTwoLetter); EventFilterHolder.Implementation = new EventFilterWrapper(); InitializeComponent(); Suspending += OnSuspending; diff --git a/Tests/Microsoft.AppCenter.Test.Windows/Channel/ChannelTest.cs b/Tests/Microsoft.AppCenter.Test.Windows/Channel/ChannelTest.cs index f2ba7cdca..bb64dcc8f 100644 --- a/Tests/Microsoft.AppCenter.Test.Windows/Channel/ChannelTest.cs +++ b/Tests/Microsoft.AppCenter.Test.Windows/Channel/ChannelTest.cs @@ -37,6 +37,8 @@ namespace Microsoft.AppCenter.Test.Channel private const int FilteringLogSemaphoreIdx = 4; private readonly List _eventSemaphores = new List { new SemaphoreSlim(0), new SemaphoreSlim(0), new SemaphoreSlim(0), new SemaphoreSlim(0), new SemaphoreSlim(0) }; + public TestContext TestContext { get;set;} + public ChannelTest() { LogSerializer.AddLogType(TestLog.JsonIdentifier, typeof(TestLog)); @@ -376,11 +378,14 @@ namespace Microsoft.AppCenter.Test.Channel private void SetChannelWithTimeSpan(TimeSpan timeSpan) { - _storage = new MockStorage(); - _channel = new Microsoft.AppCenter.Channel.Channel(ChannelName, MaxLogsPerBatch, timeSpan, MaxParallelBatches, - _appSecret, _mockIngestion, _storage); + if (TestContext.TestName != "ThrowStorageExceptionInDeleteLogsTime") + { + _storage = new MockStorage(); + _channel = new Microsoft.AppCenter.Channel.Channel(ChannelName, MaxLogsPerBatch, timeSpan, MaxParallelBatches, + _appSecret, _mockIngestion, _storage); + SetupEventCallbacks(); + } MakeIngestionCallsSucceed(); - SetupEventCallbacks(); } private void MakeIngestionCallsFail()