Options to force the version of .Net Frameworks used by a dll

T

Tim

I would like to know all the means that are available to configure/specify
the version of the .Net Frameworks that are used by a particular dll deployed
on a particular machine.

The reason for this is that I have a Managed C++ app dll built using VS .Net
1.0 against v 1.0 of the Frameworks that in certain circumstances is
incorrectly using v 2.0 of the Frameworks.

The circumstances are that the dll is being linked dynamically to a legacy
native Win32 C app and called through an exported C decl entry point (I
believe that this is not the 'correct' way to call .Net dll's from native
Win32 apps but unfortunately for practical purposes I am stuck with it). This
mechanism usually manages to use the correct version of the .Net Frameworks
and 'works'.
However, when run under Softgrid and Windows 2003, the process is incorrecly
using v 2.0 of the .Net Frameworks. So, I would like to know what my options
are to try to encourage the dll to use version 1.0 of the .Net Frameworks in
this situation.

PS It is not practical to simply remove the 'wrong' versions of the
Frameworks.
PPS I believe that the 'correct' way to invoke a .Net dll from a native
Win32 app is via COM - any advice/assistance/links to help me create the COM
i/f for a C Win32 client exe to a Managed C++ server dll (using VS .Net 1.0)
would be appreciated.
 
C

Carl Daniel [VC++ MVP]

Tim said:
I would like to know all the means that are available to
configure/specify the version of the .Net Frameworks that are used by
a particular dll deployed on a particular machine.

The reason for this is that I have a Managed C++ app dll built using
VS .Net
1.0 against v 1.0 of the Frameworks that in certain circumstances is
incorrectly using v 2.0 of the Frameworks.

The circumstances are that the dll is being linked dynamically to a
legacy native Win32 C app and called through an exported C decl entry
point (I believe that this is not the 'correct' way to call .Net
dll's from native Win32 apps but unfortunately for practical purposes
I am stuck with it). This mechanism usually manages to use the
correct version of the .Net Frameworks and 'works'.
However, when run under Softgrid and Windows 2003, the process is
incorrecly using v 2.0 of the .Net Frameworks. So, I would like to
know what my options are to try to encourage the dll to use version
1.0 of the .Net Frameworks in this situation.

In thisd case, is it possible that the 2.0 CLR is already loaded into the
process before your DLL comes along? It's only possible to load a single
version of the CLR into a given process.

-cd
 

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