在我的项目中,我必须使用不同版本的 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" />
谁能指出我做错了什么??
最佳答案
- 请在 visual studio 中打开Solution Explorer
- 打开项目下的References
- 选择 AWSSdk 引用并转到其属性。
- 设置特定版本 = True 和复制本地 = False
- 确保您的输出目录中不包含此 dll。
关于c# - 在项目中使用同一 DLL 的不同版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30662114/