首页 > 编程语言 >C# 项目中dll类库引用了多个版本,造成了冲突的解决办法

C# 项目中dll类库引用了多个版本,造成了冲突的解决办法

时间:2023-10-26 14:57:32浏览次数:31  
标签:类库 publicKeyToken 5.2 C# 0.0 System dll neutral newVersion

备注:常见问题

未能加载文件或程序集“System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个

原因分析:程序所依赖的dll 和实际引用的dll不相符,可以用修改配置文件web.config的方式实现兼容

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 <runtime>     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">       <dependentAssembly>         <assemblyIdentity name="System.Web.Http.WebHost" publicKeyToken="31BF3856AD364E35" culture="neutral" />         <bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" />       </dependentAssembly>       <dependentAssembly>         <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />         <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />       </dependentAssembly>       <dependentAssembly>         <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />         <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />       </dependentAssembly>       <dependentAssembly>         <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />         <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />       </dependentAssembly>       <dependentAssembly>         <assemblyIdentity name="System.Data" publicKeyToken="b77a5c561934e089" culture="neutral" />         <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />       </dependentAssembly>       <dependentAssembly>         <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />         <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />       </dependentAssembly>     </assemblyBinding>   </runtime>

 

标签:类库,publicKeyToken,5.2,C#,0.0,System,dll,neutral,newVersion
From: https://www.cnblogs.com/DoNetCShap/p/17789401.html

相关文章

  • [Compose] Async generator, Promise + generator
    functiongetData(d){setTimeout(()=>{if(typeofd==="number"){run.next(d/2)}else{run.next(d)}},500)}function*gen(){varx=1+(yieldgetData(10))//x=1+5......
  • Easy Excel 导出存在绿色角标问题[返回字段类型是数字,当时使用String来接收]
     一、背景EasyExcel导出,发现excel存在大量的绿色角标,很影响美观,如果个人使用可以设置wps或office忽略检测警告,但是我是对业主的,所以这一方式对我不适用,只能通过代码的方式解决. 二、实现通过以下创建一个 ExcelWriter,实现去绿色角标的关键是使用easyExc......
  • ASP.NET Core 使用 MQTTnet 实现 MQTT 通讯协议
    转自:https://www.twle.cn/t/19383MQTT是啥呢?MQTT,英文全称 MessageQueuingTelemetryTransport,是一种基于 发布/订阅 模式的轻量级的消息传输协议,由IBM公司出品。物联网兴起后,MQTT因为够轻量,低带宽和低延时而被推上浪潮之巅。其实,MQTT几乎就是专门为网络受限设备、低......
  • RtlCopyMemory 崩溃
    deviceExtension=(PDEVICE_EXTENSION)DeviceObject->DeviceExtension; deviceExtension->file_name.Length=openFileInformation->file_nameLength; deviceExtension->file_name.MaximumLength=openFileInformation->file_nameLength; deviceExtens......
  • VNC连接
    HHDESK内置VNC客户端,可提供便捷的VNC连接。首页,点击资源管理,选择新建连接;在“连接类型”的下拉框中,选择VNC。填写各个选项,点击连接。输入密码,点击解锁。即可连接。......
  • Nacos单机模式配置远程数据源、配置身份认证
    1.nacos介绍官网链接:https://nacos.io/zh-cn/docs/what-is-nacos.htmlGithub:https://github.com/alibaba/nacos/Nacos/nɑ:kəʊs/是DynamicNamingandConfigurationService的首字母简称,一个更易于构建云原生应用的动态服务发现、配置管理和服务管理平台。Nacos致力于......
  • # yyds干货盘点 # Python实现excel工作簿中单元格底色为黄色的数据筛选
    大家好,我是皮皮。一、前言前几天在Python最强王者交流群【哎呦喂 是豆子~】问了一个pandas数据提取的问题,一起来看看吧。大佬们请教个问题有没有什么办法可以实现 excel工作簿中单元格底色为黄色的行筛选出来 当行只要有一个单元格标黄了当行数据筛选出来?二、实现过程这里【......
  • 使用centos7搭建NTP服务器
    一、安装NTP服务yum-yinstallntpntpdata二、设置防火墙策略firewall-cmd--zone=public--add-port=123/udp--permanent #开放UDP123端口firewall-cmd--reload三、编辑NTP配置文件vim/etc/ntp.conf添加:server210.72.145.44prefer   #优先使用国家授时服务器serve......
  • Python实现excel工作簿中单元格底色为黄色的数据筛选
    大家好,我是皮皮。一、前言前几天在Python最强王者交流群【哎呦喂 是豆子~】问了一个pandas数据提取的问题,一起来看看吧。大佬们请教个问题有没有什么办法可以实现 excel工作簿中单元格底色为黄色的行筛选出来 当行只要有一个单元格标黄了当行数据筛选出来?二、实现过程......
  • Captura录屏软件怎样解决FFmpeg解析错误问题
    Captura怎样解决FFmpeg解析错误问题?captura软件里大家在进行屏幕录制的工作得时候都会用到captura软件,软件得功能可以满足大家的需求,可以轻松的录制屏幕,进行屏幕截屏等,但是又小伙伴在使用的时候发现了一些问题,那么怎么解决这个问题呢?还不清楚的小伙伴赶紧来看看吧!Captura解决......