如何在“任何CPU”中使用X64 buit DLL使用C#模式 [英] How to consume X64 buit DLL in "any CPU" mode using C#

查看:102
本文介绍了如何在“任何CPU”中使用X64 buit DLL使用C#模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我有wpf应用程序,其编译模式是Any CPU。问题是我需要在我的应用程序中集成clr dll,这是在X64中的buit。当我尝试集成它然后它给出运行时异常,如无法加载程序集及其依赖项。



我尝试过:



我已经给出了dll参考并尝试从dll调用函数然后它给出运行时异常

Hi i have wpf application which its compiling mode is Any CPU. The problem is i need to integrate the clr dll in my application which is buit in X64. When i try to integrate it then its giving Runtime exception like "Unable to load assembly and its dependencies".

What I have tried:

I have given dll reference and try to call the Function from dll then it giving Runtime Exception

推荐答案

任何cpu将在x64处理器上运行64位,在x86处理器上运行32位,因此必须使两个版本的DLL可用于在已安装的计算机上正常工作,并选择要在运行时加载的正确处理器DLL。

c# - 使用并排程序集加载DLL的x64或x32版本 - Stack Overflow [ ^ ]
"Any cpu" will run 64bit on x64 processors and 32bit on x86 processors, so you must have both versions of your DLL available to work properly on installed machines and choose the correct processor DLL to load at runtime.
c# - Using Side-by-Side assemblies to load the x64 or x32 version of a DLL - Stack Overflow[^]


这篇关于如何在“任何CPU”中使用X64 buit DLL使用C#模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆