6

UWP プロジェクトをデバッグすると、次のエラーが表示されます。

System.IO.FileNotFoundException: 'ファイルまたはアセンブリ 'e_sqlite3、Culture=neutral、PublicKeyToken=null' を読み込めませんでした。システムは、指定されたファイルを見つけることができません。'

エラーは次の行で発生します。 Xamarin.Forms.Forms.Init(e);

次のコード ブロックから:

protected override void OnLaunched(LaunchActivatedEventArgs e)
{
    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;

        Xamarin.Forms.Forms.Init(e);

        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 == false)
    {
        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(MainPage), e.Arguments);
        }
        // Ensure the current window is active
        Window.Current.Activate();
    }
}

ちょっとした背景...私は自分のソリューションで 3 つのプロジェクト (共有ライブラリ、WPF、および Android) から始めました。アプリケーションは現在、Android プロジェクトと WPF プロジェクトの両方で sqlite ファイルの読み取りと書き込みを行っています。

UWP プロジェクトを追加しました。共有ライブラリへの参照を追加し、関連する nuget パッケージを追加した後、UWP プロジェクトをデバッグするときにエラーが発生します。

ここに私の現在のソリューションがあります: ソリューション エクスプローラーのスクリーンショット

SQLite-net-pcl nuget バージョン 1.5.231 (投稿時の最新の安定バージョン) を使用しています。 nuget パッケージのスクリーンショット

SQLiteNetExtensions と SQLiteNetExtensions.Async nuget パッケージもあります。 すべての sqlite 関連の nuget パッケージのスクリーンショット

私の UWP プロジェクトには: ターゲット バージョン: Windows 10、バージョン 1809 最小バージョン: Windows 10 Fall Creators Update UWP ターゲット設定のスクリーンショット

この問題に関する多くの投稿を見つけましたが、それらはすべて、これが SQLite-net-pcl バージョン 1.5.166 で解決され、新しいバージョンを使用していることを示しているようです。

別の投稿では、Visual Studio の sqlite 拡張機能の使用について言及されていますが、これを見つけることができませんでした。その投稿は数年前のものであるため、Visual Studio 2015 を参照しているため、修正は関係ない可能性があります。

Visual Studio Professional 2017、バージョン 15.9.9 を使用しています。最新の更新プログラムとサービス パックがすべて適用された Windows 10 Pro ワークステーションで実行されています。

この問題を解決する方法について何か提案はありますか?

4

0 に答える 0