C# winfrom 打包安装后,报错Mixed mode assembly is built against version 'v2.0.50727' of

wirner 2017-01-10 11:30:53
请教下: 我在工程中,引入了System.Data.SQLite.dll,也会提示“ Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.”
后来配置了App.config 后,运行正常。

现在我要打包(我只把System.Data.SQLite.dll打包)安装后,提示“示“ Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.””

请问,打包工程中怎么添加配置信息?
...全文
386 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
LongRui888 2017-01-10
  • 打赏
  • 举报
回复
应该是版本不兼容吧,你的是2.05,而实际要的是4.0的运行时环境。
wirner 2017-01-10
  • 打赏
  • 举报
回复
Alternatively, as of version 1.0.91.0, all configuration settings can be specified via an optional XML configuration file. Using the XML configuration file when the primary System.Data.SQLite assembly ("System.Data.SQLite.dll") is being executed from the Global Assembly Cache is unsupported. For each configuration setting, the associated environment variable value, if present, will override the value specified via the XML configuration file. For the full .NET Framework, the XML configuration file must be named "System.Data.SQLite.dll.config" and it must be present in the base directory for the application domain or the directory containing the primary System.Data.SQLite assembly as reported by its location property; otherwise, it will be ignored. For the .NET Compact Framework, the XML configuration file must be named "System.Data.SQLite.dll.config" and it must be present in the directory containing the primary System.Data.SQLite assembly; otherwise, it will be ignored. Deployment Guidelines 这个官网上的。
wirner 2017-01-10
  • 打赏
  • 举报
回复
引用 2 楼 yupeigu 的回复:
应该是版本不兼容吧,你的是2.05,而实际要的是4.0的运行时环境。
是的,但是http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki 下不了对应4.0的SQLite。 我调试时运行正常, 就是打包安装后,运行不正常。郁闷。

2,209

社区成员

发帖
与我相关
我的任务
社区描述
其他数据库开发 其他数据库
社区管理员
  • 其他数据库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧