Home All Groups Group Topic Archive Search About

Calling .Net 2.0 Methods from .Net 1.1

Author
15 Dec 2006 11:13 AM
Taliesin Airt
I would like to call a method on a .Net 2.0 object from a .Net 1.1 object. 
The return type of the method will be void and I don't want to bind to the
assembly directly.  Basically I want to integrate old code to the new code,
while I'm upgrading the the complete solution without having downtime.

The idea I had was that this would be possible either via an Interface or
via Reflection, but I can't seem to get either to work.  So my next idea is
to go with unsafe code, but before I do this I thought one of you may have a
solution to the problem. 

Looking forward to your replies.

Author
15 Dec 2006 2:08 PM
Ciaran O''Donnell
You can't load 2.0 objects into the 1.1 clr, but you can go the other way. If
the whole app was hosted in 2.0 you could call the old dlls. Best bet is to
update the entrypoint assembly first.


Show quote
"Taliesin Airt" wrote:

> I would like to call a method on a .Net 2.0 object from a .Net 1.1 object. 
> The return type of the method will be void and I don't want to bind to the
> assembly directly.  Basically I want to integrate old code to the new code,
> while I'm upgrading the the complete solution without having downtime.
>
> The idea I had was that this would be possible either via an Interface or
> via Reflection, but I can't seem to get either to work.  So my next idea is
> to go with unsafe code, but before I do this I thought one of you may have a
> solution to the problem. 
>
> Looking forward to your replies.
Author
15 Dec 2006 8:11 PM
Ignacio Machin ( .NET/ C# MVP )
Hi,

You can call 1.1 code from 2.0 code, not the opposite.

If you are going to upgrade your solution to 2.0 you have to start with the
starting point project and only later you migrate the dlls


--
Ignacio Machin
machin AT laceupsolutions com


Show quote
"Taliesin Airt" <TaliesinA***@discussions.microsoft.com> wrote in message
news:5A4012FB-0D3B-421C-9A60-B77DD4C8614B@microsoft.com...
>I would like to call a method on a .Net 2.0 object from a .Net 1.1 object.
> The return type of the method will be void and I don't want to bind to the
> assembly directly.  Basically I want to integrate old code to the new
> code,
> while I'm upgrading the the complete solution without having downtime.
>
> The idea I had was that this would be possible either via an Interface or
> via Reflection, but I can't seem to get either to work.  So my next idea
> is
> to go with unsafe code, but before I do this I thought one of you may have
> a
> solution to the problem.
>
> Looking forward to your replies.
Author
18 Dec 2006 11:02 AM
Taliesin Airt
Hi Guys,

Though it makes sense that you can't set a reference to a .Net 2.0 assembly
from a .Net 1.1 assembly, I still think there must be a way.  I'm currently
playing with an idea of using unsafe code to create a simulator, which I
think might help me in this process and bridge the devide between the 2
versions of .Net. 

I'll post the solution once I've got it.

Show quote
"Ignacio Machin ( .NET/ C# MVP )" wrote:

> Hi,
>
> You can call 1.1 code from 2.0 code, not the opposite.
>
> If you are going to upgrade your solution to 2.0 you have to start with the
> starting point project and only later you migrate the dlls
>
>
> --
> Ignacio Machin
> machin AT laceupsolutions com
>
>
> "Taliesin Airt" <TaliesinA***@discussions.microsoft.com> wrote in message
> news:5A4012FB-0D3B-421C-9A60-B77DD4C8614B@microsoft.com...
> >I would like to call a method on a .Net 2.0 object from a .Net 1.1 object.
> > The return type of the method will be void and I don't want to bind to the
> > assembly directly.  Basically I want to integrate old code to the new
> > code,
> > while I'm upgrading the the complete solution without having downtime.
> >
> > The idea I had was that this would be possible either via an Interface or
> > via Reflection, but I can't seem to get either to work.  So my next idea
> > is
> > to go with unsafe code, but before I do this I thought one of you may have
> > a
> > solution to the problem.
> >
> > Looking forward to your replies.
>
>
>

AddThis Social Bookmark Button