Prevent framework 2.0 - when called through COM

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a .net program written in 1.1, that doesn't work in .net 2.2.

We use it from a non-dotnet application, so it is called through a COM
interface.
The problem is that when it is called through the COM interface, it runs in
2.0 and fails.

How do I prevent that?
 
Off the top of my head: Set it up as an app so you can add a config. Set the
config to require runtime 1.1.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
In your non .NET program, you can first bind to a specific version of
..NET Framework using the unmanaged hosting api, e.g.,

ICorRuntimeHost* spRuntimeHost = NULL;
HRESULT hr = CorBindToRuntimeEx(
L"v1.1.4322",
L"wks", //Request a WorkStation build of the CLR
STARTUP_CONCURRENT_GC,
STARTUP_LOADER_OPTIMIZATION_SINGLE_DOMAIN,
CLSID_CorRuntimeHost,
IID_ICorRuntimeHost,
(void**)&spRuntimeHost
);
if (SUCCEEDED(hr))
hr = spRuntimeHost->Start();

This will force v1.1.4322 to be loaded. Make sure you do this before
any other .NET stuff coming up. I have used this on remotesoft tools,
and it work well for us.

Huihong
http://www.remotesoft.com
The best possible ways to secure .NET Code from decompilation
 
Back
Top