简体   繁体   中英

Trying to connect Unity3d with a DLL that uses SQL Server Compact Missing or incorrect header for method CompileQueryPlan?

I'm working on a Unity3d project that involves Databases, I wanted the other developer to work on the server's and produce a DLL for me to use in Unity

I tried to work directly in Unity with SqlServerCe but it always stated that it's missing libs So I managed to load the Backend's DLL successfully in Unity3D (Using v3.5 .Net Client Profile, in both the VS and Unity's Mono Develop)

It initializes the SQL components successfully (reader ... etc) But when I execute the reader the DLL returns this exception as a string (I handled that when an exception occurs it's returned as a string)

The Exception:

System.InvalidProgramException: Missing or incorrect header for method CompileQueryPlan
  at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand (CommandBehavior behavior, System.String method, ResultSetOptions options) [0x00000] in <filename unknown>:0 
  at System.Data.SqlServerCe.SqlCeCommand.ExecuteReader (CommandBehavior behavior) [0x00000] in <filename unknown>:0 
  at System.Data.SqlServerCe.SqlCeCommand.ExecuteReader () [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.Data.SqlServerCe.SqlCeCommand:ExecuteReader ()
  at AbuEl3orrefDatabaseBackend.DBHandler.PrepareAllQuestions () [0x00000] in <filename unknown>:0 

好吧,我终于找到了解决方案,因为它不支持SQL Server Compact,所以它位于Web平台上,所以我从“构建设置”切换到了“桌面平台”。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM