Calling 2.0 from 1.1

A

Abhishek

I've both version 2.0 Beta and 1.1 of dotnet framework installed on my
system.

I've an assembly which is built on version 1.1 and loads an assembly
dynamically reading the location of assembly from the config file. This
assembly works fine when config file asks to load an assembly which is
built on 1.1 framework but now i've to load an assembly which is made
on 2.0 Beta. When i try to give the path of such an assembly the Loader
throws a BadImageFormatException which is genuine exception b'coz it
can't load such an assembly which is targeted for a different runtime.
My question is that is there someway to ask .NET framework to do this
for me may be something like framework 1.1 asks framework 2.0 beta to
load the assembly in its runtime and do the job for me .

Any inputs will help

Thanks in advance
Abhishek
 
M

Mattias Sjögren

My question is that is there someway to ask .NET framework to do this

Do what exactly?

may be something like framework 1.1 asks framework 2.0 beta to
load the assembly in its runtime and do the job for me .

There can only be one version of the CLR loaded in your process. The
only way to use a v2.0 assembly is to run the application with the
v2.0 CLR.



Mattias
 
N

NuTcAsE

You can try adding the following configuration section to you
app.config file:


<startup>
<requiredRuntime version="[VersionNo]" safemode="true"/>
</startup>

In place of [VersionNo], enter the exact version of your 2.0 framework.
You can get that be looking at the
%WINDIR%\Microsoft.NET\Framework folder and getting the version no of
the 2.0 framework. This will only work if your sure your 1.1 assembly
will run under 2.0 which should be for most of the cases since 1.1 apps
are portable to 2.0.

Hope this helps.

NuTcAsE
 

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