Mixed DLLs, VS 2003 and 2005

R

rwf_20

My setup consists of two DLLs and an EXE, all C++.

The EXE is unmanaged, and calls an unmanaged DLL. The unmanaged DLL
calls a managed DLL.

If I build all three in the same version of VS, everything works as
expected.

In practice, I can match the DLLs, but not the EXE (that is, it could
be built in 7.0, 7.1, 8.0, etc). If I build the EXE in 7.1 and the
DLLs in 8.0, attempts to load the managed DLL fail with error code
1114.

I've done a lot of googling on the subject, and the only fix I've
found consists of specifying the appropriate (8.0) runtime to the EXE
via a config file. This is sub-optimal since I can't really control
the calling EXE at all (3rd party).

So, long story short: Is there any way to build a managed DLL in .NET
2.0 that can be loaded by an unknown process? I can assume the user
has .NET 2.0 installed.


If this makes any sense, any help is appreciated.

Ryan
 
B

Ben Voigt

So, long story short: Is there any way to build a managed DLL in .NET
2.0 that can be loaded by an unknown process? I can assume the user
has .NET 2.0 installed.

It is not possible to load multiple versions of the framework into a single
process, so if the .exe loads .NET 1.x, no DLLs within it can use .NET 2.0.

Therefore, you must force the process to load only .NET 2.0 or greater.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top