c# - 在项目中使用同一 DLL 的不同版本

标签 c# .net dll

在我的项目中,我必须使用不同版本的 AWSSDK dll,为了做到这一点,我求助于 this post .并将我的一个 dll 添加到 bin 文件夹内名为 V-1 的文件夹中。然后像这样进行配置更改

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>        
        <assemblyIdentity name="AWSSDK" publicKeyToken="CD2D24CD2BACE800" culture="neutral" />
            <codeBase version="1.4.8.2" href="V-1\AWSSDK.dll" />
            <codeBase version="2.3.40.0" href="AWSSDK.dll" />
        </dependentAssembly>      
    </assemblyBinding>
</runtime>

但是还是报这样的错

Error 2 Could not load file or assembly 'AWSSDK, Version=1.4.8.2, Culture=neutral, PublicKeyToken=cd2d24cd2bace800' or one of its dependencies. The system cannot find the file specified. E:\Live \Web.config 129

在 web-Config 的这一行

 <add assembly="AWSSDK, Version=1.4.8.2,  Culture=neutral, PublicKeyToken=CD2D24CD2BACE800" />

谁能指出我做错了什么??

最佳答案

  1. 请在 visual studio 中打开Solution Explorer
  2. 打开项目下的References
  3. 选择 AWSSdk 引用并转到其属性。
  4. 设置特定版本 = True复制本地 = False
  5. 确保您的输出目录中不包含此 dll。

关于c# - 在项目中使用同一 DLL 的不同版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30662114/

相关文章:

c# - 如何使用 C# 从 xml 文档中删除重复元素而不用乱写 xml 结构

c# - 工具提示气球显示位置(用于错误通知)

.net - 最有用的 .NET 实用程序类开发人员倾向于重新发明而不是重用

c# - C# 中的 Locks 和 Mutexes 应该一起使用吗

c# - 如何获取 MemberInfo 的值?

c# - 从 Wiimote 转向相机?

c# - 自行重启应用程序

c# - 如何检查 .NET DLL 是否已注册?

c# - SetCursorPos 不工作

c++ - 鼠标移动增加代码执行速度 VB with C DLL