加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

sqlite3 – 运行ServiceStack示例的System.BadImageFormatExcept

发布时间:2020-12-12 19:12:50 所属栏目:百科 来源:网络整理
导读:我正在尝试运行 ServiceStack个示例项目.当我运行Web客户端时,我收到以下错误: {System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at Mono.Data.Sqlite.UnsafeNati
我正在尝试运行 ServiceStack个示例项目.当我运行Web客户端时,我收到以下错误:
{System.BadImageFormatException: An attempt was made to load a program with an 
    incorrect format. (Exception from HRESULT: 0x8007000B)
    at Mono.Data.Sqlite.UnsafeNativeMethods.sqlite3_open_v2(Byte[] utf8Filename,IntPtr& db,Int32 flags,IntPtr vfs)
    at Mono.Data.Sqlite.SQLite3.Open(String strFilename,SQLiteOpenFlagsEnum 
    flags,Int32 maxPoolSize,Boolean usePool)
    at Mono.Data.Sqlite.SqliteConnection.Open()
    at ServiceStack.OrmLite.OrmLiteConnection.Open()
    at ServiceStack.OrmLite.OrmLiteConnectionFactory.OpenDbConnection()
    at ServiceStack.Examples.ServiceInterface.Support.ConfigureDatabase
         .Init(IDbConnectionFactory connectionFactory) 
    in E:ServiceStack.ExamplessrcServiceStack.Examples
    ServiceStack.Examples.ServiceInterfaceSupportConfigureDatabase.cs:line 23}

我已经下载了最新的System.Data.SQLite.dll文件并试图使用它,但我仍然遇到同样的错误.我在Windows 7 64位盒子上运行64位VS2010.

将主项目的平台目标设置为x86以解决此问题.这可以在Project …下完成 – >属性 – >建立.

SqlLite很可能是一个32位组件,并且为了能够加载它,您的应用程序也需要是一个32位应用程序(64位进程不能加载32位组件,反之亦然).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读