0

Microsoft アプリ認定キットを使用して、UWP アプリケーションをストアに提出するためにテストしようとしています。私が持っている唯一の問題は次のとおりです。

アプリの onlaunched メソッドの実装で、launchactivatedeventargs.prelaunch オプションを処理して事前起動イベントを認識するようにしてください。

変更したことはありません。Visual Studio の元のプロジェクトを使用しています。

sealed partial class App : Application
{
    /// <summary>
    /// Initializes the singleton application object.  This is the first line of authored code
    /// executed, and as such is the logical equivalent of main() or WinMain().
    /// </summary>
    public App()
    {
        this.InitializeComponent();
        this.Suspending += OnSuspending;
    }

    /// <summary>
    /// Invoked when the application is launched normally by the end user.  Other entry points
    /// will be used such as when the application is launched to open a specific file.
    /// </summary>
    /// <param name="e">Details about the launch request and process.</param>
    protected override async void OnLaunched(LaunchActivatedEventArgs e) {
    #if DEBUG
        if (System.Diagnostics.Debugger.IsAttached) {
            this.DebugSettings.EnableFrameRateCounter = true;
        }
    #endif
        Frame rootFrame = Window.Current.Content as Frame;

        // 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();

            rootFrame.NavigationFailed += OnNavigationFailed;

            if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) {
                //TODO: Load state from previously suspended application
            }

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

        if (!e.PrelaunchActivated) {
            if (rootFrame.Content == null) {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(FormView), e.Arguments);
            }

            // Ensure the current window is active
            Window.Current.Activate();
        }

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

    /// <summary>
    /// Invoked when Navigation to a certain page fails
    /// </summary>
    /// <param name="sender">The Frame which failed navigation</param>
    /// <param name="e">Details about the navigation failure</param>
    void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
    {
        throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
    }

    /// <summary>
    /// Invoked when application execution is being suspended.  Application state is saved
    /// without knowing whether the application will be terminated or resumed with the contents
    /// of memory still intact.
    /// </summary>
    /// <param name="sender">The source of the suspend request.</param>
    /// <param name="e">Details about the suspend request.</param>
    private void OnSuspending(object sender, SuspendingEventArgs e)
    {
        var deferral = e.SuspendingOperation.GetDeferral();
        //TODO: Save application state and stop any background activity
        deferral.Complete();
    }
}

私は少しグーグルで検索しましたが、誰もがこのリンクから UWP などの Template10 について話している App Certification fails due to PreLaunch Test

助言がありますか?ありがとうございました! Microsoft アプリ認定キットの不合格結果

4

2 に答える 2

1

はい、これは WACK を渡す方法です。以前に WACK に失敗した場合でも、パッケージがストア認定に合格する場合があります。

[ビルド] セクションのプロジェクト プロパティでプロジェクトをテストし、[. NET ツール チェーンでコンパイル] をオンにした場合、それはプロジェクトを [リリース] モードで実行することを意味します。デフォルトでは、アプリは .NET ネイティブ ツールチェーンを利用します。パッケージはネイティブ バイナリにコンパイルされるため、パッケージに .NET フレームワーク ライブラリを含める必要はありません。さらに、このパッケージは、CoreCLR パッケージではなく、インストールされている最新の .NET ネイティブ ランタイムに依存しています。デバイス上の .NET ネイティブ ランタイムは、アプリケーション パッケージと常に互換性があります。「リリース」構成によるローカル ネイティブ コンパイルにより、顧客が経験するのと同様の環境でアプリケーションをテストできます。開発を進める上で、これを定期的にテストすることが重要です。

ストアは提出したパッケージを .NET Native モードでテストするため、「Compile with .NET tool chain」をチェックすることで認定に合格します。

また、 .NET Native についてはこちらの記事がありますので、参考にしてください。

于 2016-10-28T10:22:16.257 に答える
0

解決策を見つけたと思いますが、幸運な偶然かもしれません。

[ビルド]セクションの [プロジェクト プロパティ] の下で、[. NET ネイティブ ツール チェーンでコンパイル]をチェックすると、結果が渡されます。

Visual Studio 2015 > プロジェクト プロパティ

正しい答えだと思いますか?

于 2016-10-27T14:13:15.120 に答える