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

wirner 2017-01-10 12:58:57
请教下: 我在工程中,引入了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.””

请问,打包工程中怎么添加配置信息?

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


这个官网上的。
...全文
254 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
wirner 2017-01-10
  • 打赏
  • 举报
回复
自己顶一下
wirner 2017-01-10
  • 打赏
  • 举报
回复
引用 1 楼 royler 的回复:
这个问题应该是你的 项目是4.0的,你引入的sqlite是2.0的, 以后安装东西用 nuget安装,
谢谢,我了解下nuget,调试时,也遇到这个问题,修改了App.config
<?xml version="1.0" encoding="utf-8" ?>  
<configuration>  
    <startup useLegacyV2RuntimeActivationPolicy="true">   
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />  
    </startup>  
</configuration>  
在打包时,怎么也写一个配置信息?
royler 2017-01-10
  • 打赏
  • 举报
回复
这个问题应该是你的 项目是4.0的,你引入的sqlite是2.0的, 以后安装东西用 nuget安装,

111,092

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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