English 中文(简体)
与土著DLLL的同类集会
原标题:Load assembly from same folder with a native DLL

我有这一(native)COM服务器,请打电话N.dll,其中从一个有管理的大会中打过一部分APIC,请打电话M.dll。 为此,存在一种混合型的DLL,可以相互连接;请打电话MM.dll。 三个DLs(N、M和MM)居住在同一个DLL公司,而COM服务器显然适当注册。

I m using the M.dll assembly with a using directive in MM.dll.

#using "M.dll"
using namespace M;

然后,就立即使用M中现有的类型。

如今,这一通信服务器可以通过任何申请进行即时运行,并居住在系统的任何地点。 这显然符合一切权利。 但是,一旦N需要从M(通过MM)打电话,我就会收到<条码>。 (未处理例外:系统.IO.FileNotFoundException: 不能装载文件或组装M, FCCC/SBI/2008/8。 该系统无法找到具体档案。

If I copy the M.dll assembly to the same folder where the executable is, then everything works fine. However, this is not a solution, since there can be a lot of apps consuming the COM server, and I cannot deploy M.dll to all those places. And I also cannot do something with a config file for the process, for the same reason. I need a way to tell the mixed-mode MM.dll module to load the managed assembly from the same folder where it is located.

这是可能的吗?

问题回答

见关于Windows如何定位DLs on msdn的讨论(





相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签