2013-04-19 2 views
0

Я собираюсь завершить свое первое приложение для Windows Store, и последние два дня я столкнулся с проблемой во время тестирования приложений с помощью пакета сертификации приложений для Windows.Комплект сертификации приложений для Windows: тест сбоев и зависаний завершился

Тест терпит неудачу в «аварии и вешает» тест, и им получать следующее сообщение:

Crashes and hangs 
Error Found: The crashes and hangs test detected the following errors: 
Application ....................0.0.12_x86__jarrs3vj594qe was detected by Windows Error Reporting and experienced a crash or hang. 
Impact if not fixed: An app that stops responding or crashes can cause data loss and is a poor user experience. 
How to fix: Investigate, debug the executable(s) in question to identify and fix the problem, then rebuild and re-test the app. 

После некоторого тестирования с подвеской и выключением в режиме отладки я обнаружил, что мое приложение падает, если: бежать я Debugging => Suspend and Shutdown => снова запустить Debugging. и ошибка говорит о том, что SuspensionManager не удалось выполнить: weather.Common.SuspensionManager.RestoreAsync();

Я думаю, что эта проблема связана с моим расширенным экраном Splash без экрана Exteded Splash. Я не получаю эту ошибку, и приложение проходит тест «Сбой и зависания». Вот код App.xaml.cs и расширенный экран-заставка:

sealed partial class App : Application 
{ 
    // Defining gloabal variables used across the App 
    public string[] NavigateData { get; set; } 
    public NavigationCacheMode NavigationCacheMode { get; set; } 
    public parameterItem max1DayAgo = new parameterItem(); 
    public parameterItem min1DayAgo = new parameterItem(); 
    public parameterItem max1WeekAgo = new parameterItem(); 
    public parameterItem min1WeekAgo = new parameterItem(); 

    public parameterItem max1MonthAgo = new parameterItem(); 
    public parameterItem min1MonthAgo = new parameterItem(); 


public List<NameValueItem> tempTrends24Hours = new List<NameValueItem>(); 
    public List<NameValueItem> tempTrends30Days = new List<NameValueItem>(); 

    public List<NameValueItem> windSpeedTrends24Hours = new List<NameValueItem>(); 
    public List<NameValueItem> windSpeedTrends30Days = new List<NameValueItem>(); 


    public List<NameValueItem> windDirectionTrends24Hours = new List<NameValueItem>(); 
    public List<NameValueItem> windDirectionTrends30Days = new List<NameValueItem>(); 

    public List<NameValueItem> windChillTrends24Hours = new List<NameValueItem>(); 
    public List<NameValueItem> windChillTrends30Days = new List<NameValueItem>(); 

    public List<NameValueItem> humidityTrends24Hours = new List<NameValueItem>(); 
    public List<NameValueItem> humidityTrends30Days = new List<NameValueItem>(); 
    public string appBackgGround; 

    public App() 
    { 
     this.InitializeComponent(); 
     this.Suspending += OnSuspending;  
    } 


    protected async override void OnLaunched(LaunchActivatedEventArgs args) 
    { 

     // 
     if (args.PreviousExecutionState == ApplicationExecutionState.Running) 
     { 
      Window.Current.Activate(); 
      return; 
     } 

     Frame rootFrame = Window.Current.Content as Frame; 

     //Getting live tile data 
     var uris = new List<Uri> 
       { 
        new Uri("..........WebService.asmx/GetFirstTile"), 
        new Uri("............./GetSecondTile"), 
        new Uri("................./GetStatisticTile"), 
        new Uri(".............../GetNewsTile1"), 
        new Uri("............../GetNewsTile2"),     
       }; 

     TileUpdater LiveTileUpdater = TileUpdateManager.CreateTileUpdaterForApplication(); 
     LiveTileUpdater.EnableNotificationQueue(true); // Enable notifications 
     LiveTileUpdater.Clear(); // Clear the current set of updates 
     LiveTileUpdater.StartPeriodicUpdateBatch(uris, PeriodicUpdateRecurrence.HalfHour); 

     //getting bacground image 
     try 
     { 
      ServiceReference.WebServiceSoapClient webServiceObj = new ServiceReference.WebServiceSoapClient(); 
      appBackgGround = await webServiceObj.GetBackgroundImageAsync();// Get the name of the Background picture 
     } 
     catch 
     { 
     appBackgGround = "backgroundImageBlueSky.jpg"; 

     } 



     // 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(); 
      weather.Common.SuspensionManager.RegisterFrame(rootFrame, "appFrame"); 

      // Her we set the application background Image for all pages "backgroundImageBlueSky.jpg" 
      rootFrame.Background = new ImageBrush 
      { 
       Stretch = Windows.UI.Xaml.Media.Stretch.UniformToFill, 
       ImageSource = new BitmapImage { UriSource = new Uri("ms-appx:///Assets/" + appBackgGround) } 

      }; 

      if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) 
      { 
        //TODO: Load state from previously suspended application 
        await weather.Common.SuspensionManager.RestoreAsync(); 

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

     if (rootFrame.Content == null) 
     { 
      // Navigating to the extended splash screen 
      if (!rootFrame.Navigate(typeof(ExtendedSplashScreen), rootFrame.GetNavigationState())) 
      { 
       throw new Exception("Failed to create initial page"); 
      } 
     } 
     // About page 
     var _Helper = new Flyouts.SettingsHelper(); 

     _Helper.AddCommand<Flyouts.About>("About"); 
     Window.Current.Activate(); 
    }  
    private async void OnSuspending(object sender, SuspendingEventArgs e) 
    { 
     var deferral = e.SuspendingOperation.GetDeferral(); 
     //TODO: Save application state and stop any background activity 
     await weather.Common.SuspensionManager.SaveAsync(); 
     deferral.Complete(); 
    } 
} 

Код для протяженных Полноэкранный разбрызгивания: Здесь я сделать несколько вызовов веб-сервиса для того, чтобы загрузить данные для первой страницы.

public sealed partial class ExtendedSplashScreen : Page 
    { 


     public ExtendedSplashScreen() 
     { 
      this.InitializeComponent(); 
     } 

     protected override async void OnNavigatedTo(NavigationEventArgs e) 
     { 
      /* 
      * ........ 
      * .......... 
      * ........... 
      * ........... 
      * ............ 
      * Here i do some webservice calls to get data for the first page(Mainpage 
      * 
      */ 


      (App.Current as App).NavigateData = startupData;// save the data for the Mainpage to the Global variables 

      this.Frame.SetNavigationState(e.Parameter as string);   
      this.Frame.Navigate(typeof(MainPage));// Finally navigate to the Mainpage 
     }  
    } 
} 

Любые идеи, как я могу это решить?

ответ

0

Вы обновили визуальную студию 2012 до обновления 2? Если нет, сделайте это и повторите попытку. В любом случае, убедитесь, что загрузка не занимает больше 5 секунд или вы не получите сертификацию.

Смежные вопросы