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

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

Post by VGlt » Fri, 06 Jun 2008 22:52:01


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.
 
 
 

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

Post by Carl Danie » Sat, 07 Jun 2008 14:48:41


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