0

Sqlite を使用した Windows Phone 8 アプリがありますが、これはデバッグ ビルドでは正常に動作しますが、リリース ビルドではファイルが見つからないようです。

リリース ビルドでアプリを実行すると、コンソールに長い一連の例外が表示されます。

ここにスニピットがあります:

An exception of type 'System.Security.SecurityException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'System.Security.SecurityException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
A first chance exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.ni.dll
An exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'System.Security.SecurityException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'System.Security.SecurityException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
A first chance exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.ni.dll
An exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'System.Security.SecurityException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'System.Security.SecurityException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
A first chance exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.ni.dll
An exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'System.Security.SecurityException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'System.Security.SecurityException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
A first chance exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.ni.dll
An exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary

...そしてずっと。この種の例外がリリース ビルドでのみポップアップするという経験をした人はいますか? そして、これをデバッグするための最良のアプローチは何でしょうか? コードのどの部分がこれを引き起こしているのかさえわかりませんか?

簡潔にするために、詳細はすべて以下のとおりです。

とりわけ、私のデータベース ファイルが見つからないことは明らかです。アプリのディレクトリにローカルに保存されたsqliteデータベースファイルがあり、アプリが起動すると、ローカルフォルダーにコピーされ、そこから読み書きされます。これはすべてのデバッグ ビルドで問題なく動作しましたが、現在、「データベース ファイルを開けません:」のログ エラー (詳細は以下) が表示され、その後に (これまでは正しい) データベース ファイルのパスが表示され、UI 要素は表示されません。データベースへの呼び出しを含むものが表示されています。

ロギングメッセージについて言及しました。明らかに、リリース ビルドで System.Diagnostic.Debug を使用してコンソール プリントを取得していませんが、アプリで読み取ることができるファイルに書き込むログ システムがあります。

これはうまく機能しているようで、アプリで問題なく読み取ることができます。

また、最初に SQLite を使用したリリース ビルドでいくつかのエラーがポップアップ表示されましたが、それらは古いバージョンの SQLite c# コードを使用したことが原因のようで、次の手順に従うと解消されました。 Windows Phone 8 で SQLite を使用するための回避策応用

4

1 に答える 1

2

SecurityExceptionデバッガーでリリース ビルドを実行し、Visual Studio の [デバッグ] > [例外] メニューで設定を変更して、 がどこからスローされたかを確認する必要があります。

これにより、少なくともこれがどこから来ているのかを見つけることができます。

于 2013-03-08T06:54:12.207 に答える