12

当我在基于模板 10 的应用程序上运行应用程序认证时,我收到以下错误:

发现错误:应用预启动验证检测到以下错误:◦应用未通过预启动测试 - 49581RisingSoundMedia.ElectionCentral_1.1.7.0_x64__xrbjpqg44kdgm。

•未修复时的影响:应用程序将需要更长的时间才能启动,即使启用了预启动也是如此。

•如何解决:在应用程序的 OnLaunched 方法实现中,确保您处理 LaunchActivatedEventArgs.PreLaunch 选项以感知预启动事件。

显然,即使使用模板 10,我也无法覆盖 OnLaunched,因为 Bootstrap 类将其密封。

我尝试覆盖 OnPreLaunchAsync 并设置 continueStartup = false; 但它并没有解决问题。

有任何想法吗?

4

3 回答 3

9

这似乎是 Windows App Cert Kit 的一个已知问题:https ://developer.microsoft.com/en-us/windows/develop/app-certification-kit

如果您在版本 1607(Windows 周年版)之前发布的 Windows-10 版本上运行,则应用预启动验证测试将失败。请注意,此测试不作为 Windows 应用商店提交的最终认证的一部分运行

解决方案:为确保通过此测试的结果,请使用在 Windows-10 周年版上运行的 Windows-10 SDK 版本 (14393) 进行测试

于 2016-08-25T21:39:14.647 回答
8

事实证明,我能够发布到商店,并且它通过了认证,即使它在本地没有通过本地 Windows 应用程序证书工具包。

于 2016-03-18T21:57:43.397 回答
4

是的,我遇到了这个问题,首先你有没有更新到模板 10 (1.1.4) 的最新版本:https ://www.nuget.org/packages/template10

接下来我要做的就是将我在 OnInitializeAsync 和 OnStartAsync 中的所有代码(在 app.xaml.cs 中)移动到 App() 中。

你需要保持 OnInitializeAsync 和 OnStartAsync 尽可能精简,你应该只保留必要的 Template10 代码并在 App() 中添加你的特定代码。

      public override Task OnInitializeAsync(IActivatedEventArgs args)
        {
            // content may already be shell when resuming
            if ((Window.Current.Content as ModalDialog) == null)
            {
                // setup hamburger shell
                var nav = NavigationServiceFactory(BackButton.Attach, ExistingContent.Include);
                Window.Current.Content = new ModalDialog
                {
                    DisableBackButtonWhenModal = true,
                    Content = new Shell(nav),
                    ModalContent = new Views.Busy(),
                };
            }
            return Task.CompletedTask;
        }


  public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            NavigationService.Navigate(typeof(MainView));
            return Task.CompletedTask;
        }

在 App() 中,我为我的应用添加了所有初始化方法,因此我的 App() 看起来像这样:

    public App()
    {
        Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
            WindowsCollectors.Metadata |
            WindowsCollectors.UnhandledException |
            WindowsCollectors.PageView |
           WindowsCollectors.Session

            );

        this.InitializeComponent();
       var element = new ViewModelLocator();
        //Template10.Services.LoggingService.LoggingService.Enabled = true;


        //Template 10 stuff
        // DOCS: https://github.com/Windows-XAML/Template10/wiki/Docs-%7C-Cache
        CacheMaxDuration = TimeSpan.FromDays(1);

        // DOCS: https://github.com/Windows-XAML/Template10/wiki/Docs-%7C-BackButton
        ShowShellBackButton = SettingsService.Instance.UseShellBackButton;

        // DOCS: https://github.com/Windows-XAML/Template10/wiki/Docs-%7C-SplashScreen
        SplashFactory = (e) => new Views.Splash(e);


        //My code here
        ApiRoot.Instance.Init(); 
        InitDeviceTypeAndResource();
        InitApiLanguage();
        InitAppLanguage();
        InitABCRatings();

        //For updating Tiles
        RegisterBackgroundTask();
    }

我希望这可以帮助你!

于 2016-02-23T21:42:03.853 回答