Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / November 2005

Tip: Looking for answers? Try searching our database.

can I configure an unmanaged app to use a certain version of the runtime?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bg - 01 Nov 2005 16:39 GMT
hi all,

I have an unmanaged app that uses some dotnet based components we have
written via COM (the components are registered for COM interop). The
components are all written/use v 1.1 of the dotnet runtime.

With the dotnet 2.0 runtime installed, we are finding the app blows up
trying to create the components and we can see in the debugger that the
wrong version of the runtime is being loaded when we try to create the
components.

Is it possible to some how configure the app to only use v 1.1 of the
runtime?

TIA

bg
Nicole Calinoiu - 01 Nov 2005 16:57 GMT
This is done via the application's configuration file.  See
http://msdn2.microsoft.com/en-us/library/w4atty68 for implementation details
and http://msdn2.microsoft.com/en-us/library/9w519wzk if you would like a
bit more background info.

> hi all,
>
[quoted text clipped - 13 lines]
>
> bg
Willy Denoyette [MVP] - 01 Nov 2005 23:58 GMT
> hi all,
>
[quoted text clipped - 13 lines]
>
> bg

Unfortunately, you can't, when an unmanaged application calls into a managed
assembly, the latest CLR version available will be loaded in the calling
unmanaged process, even if the assembly was built with an older version of
the framework. The reason for this is that it should be possible to load/run
v1.x and v2.0 assemblies into the same process side by side, and as you need
the v2.0 CLR to run the v2.0 assemblies, the v2.0 version will be loaded.

Willy.
Metallikanz! - 05 Nov 2005 13:03 GMT
A managed app will always load the CLR against which it was build and
tested, things are different for an unmanaged app, which will roll over and
always load the latest version of the CLR.

This can however be controlled by creating a CLR host which can then be
configured to load the required version of the CLR using the
CorBindToRuntimeEx() hosting API call.

Google on CLR hosting for more information and also have a look at an
article about this (probably at GotDotNet) by Steven Pratschner.

HTH, Metallikanz!

> hi all,
>
[quoted text clipped - 13 lines]
>
> bg

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.