我想追查只出現在一些客戶端機器上的錯誤,當然我們不能在內部重現錯誤。引發的InnerException
是SQLite錯誤沒有這樣的列使用實體框架
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數據庫文件,並正確加載了System.Data.SQLite
和System.Data.SQLite.Linq
dll,但是由於某些機器似乎認爲此列丟失的一些奇怪原因。
我們使用的數據庫是加密的,我們有一個應用程序的app.config文件,確保其他安裝的SQLite不會干擾應用程序。
<?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>
我不知道爲什麼這在某些機器上失敗。任何想法都不勝感激:-)
列的名稱是什麼?任何有趣的事情,例如它是否包含重音字符? – 2012-07-20 15:53:38
@JonSkeet在某些機器上拋出錯誤的列的名稱是UserDefinedPid。沒有什麼特別有趣的,除了它在某些機器上失敗,而在其他機器上失敗的事實。有問題的機器正在運行Windows 7 Professional SP1 64位。 – 2012-07-20 17:52:38