1
我正在使用SQLite開發我的應用程序,在「調試」模式下工作完美。UWP - 在原生編譯時出現SQLite問題
當我嘗試「釋放」它(編譯「Native」)時,問題開始,看起來像UWP不支持Reflexion。
我目前使用該套餐:
SQLite.Core.UAP
SQLite.Net-PCL
例如,如果我嘗試這樣做:
private void CreateDatabase()
{
var dbPath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "StoredEvents.sqlite");
SQLiteConnection SQLiteConn = new SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), dbPath, false);
SQLiteConn.CreateTable<StoredEvents>();
}
這些都是錯誤的:
ILTransform_0027: Method 'CreateLambda' within 'System.Linq.Expressions.Expression' could not be found.
Error at SerializationAssemblyGenerator.Program.AddKnownContractsLists(McgCodeTypeDeclaration container, ContractTables tables)
Severity Code Description Project File Line Suppression State
Error at SerializationAssemblyGenerator.Program.GenerateDataContractSerializerHelperCode(IEnumerable`1 contracts, IEnumerable`1 jsonContracts, IEnumerable`1 wcfSerializers)
ILTransform_0000: MCG : warning MCG0006: Unresolved P/Invoke method '_TPM_Init!tpm.dll' in assembly 'TSS.UWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it is not available in UWP applications. Please either use an another API , or use [DllImport(ExactSpelling=true)
我應該如何重構代碼?
我應該使用不同的庫嗎?