一部のクライアント マシンでのみ発生するバグを追跡しようとしていますが、もちろん社内でエラーを再現することはできません。InnerException
投げたのは
SQLite エラーのような列はありません: Extent1.UserDefinedPid
見つからない列は、SQLite データベースで次のように定義されたビット フィールドです。
[UserDefinedPid] bit NOT NULL DEFAULT 0
EDMX ファイルには、次の定義が含まれています (内容の一部のみ)。
<EntityType Name="Parameter">
<Key>
<PropertyRef Name="ParameterID" />
</Key>
<Property Type="Int64" Name="ParameterID" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
...
<Property Type="Boolean" Name="UserDefinedPid" Nullable="false" />
...
</EntityType>
同じ SQLite データベース ファイルと適切な dll が読み込まれていることを確認しましたSystem.Data.SQLite
がSystem.Data.SQLite.Linq
、奇妙な理由により、一部のマシンはこの列が欠落していると考えているようです。
使用しているデータベースは暗号化されており、SQLite の他のインストールがアプリケーションに干渉しないようにするためのアプリケーション用の app.config ファイルがあります。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections></configSections>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite" />
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
</DbProviderFactories>
</system.data>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Data.SQLite" culture="neutral" publicKeyToken="db937bc2d44ff139" />
<bindingRedirect oldVersion="1.0.0.0 - 2.0.0.0" newVersion="1.0.66.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
一部のマシンでこれが失敗する理由については、私には考えがありません。どんなアイデアでも大歓迎です:-)