gpt4 book ai didi

c# - 在 Asp.Net 中并行运行相同 Dll 的两个版本

转载 作者:太空宇宙 更新时间:2023-11-03 10:29:36 26 4
gpt4 key购买 nike

我需要同时在我的网站上运行同一个 Dll 的两个版本。所以我在 Bin 中创建了一个文件夹,并像这样显示了第二个 Dll 路径

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="AWSSDK" culture="neutral" publicKeyToken="9f476d3089b52be3"/>
<codeBase version="2.3.40.0" href="FILE://E://Live /bin/V-2/AWSSDK.dll"/>
</dependentAssembly>
</assemblyBinding>

并在 bin 文件夹中添加了我的第一个普通 dll。但是当我尝试访问我的 AWSSDK 2.3 Dll 中的任何函数时,它会抛出这样的错误

"Could not load file or assembly 'AWSSDK, Version=2.3.41.0, Culture=neutral, PublicKeyToken=9f476d3089b52be3' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"AWSSDK, Version=2.3.41.0, Culture=neutral, PublicKeyToken=9f476d3089b52be3"

谁能指出我在这里做错了什么?

最佳答案

这个错误是因为你可能有不同版本的 ddl 但命名空间是相同的,你只能在你的项目中引用不同的命名空间。

为了克服这个问题,为两个版本创建不同的 namespace 或使用 strong names for assemblies .

关于c# - 在 Asp.Net 中并行运行相同 Dll 的两个版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30724219/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com