How to compile for .net 1.1 & 2.0?

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

Guest

Hi;

How can I build a dll so it runs under both .net 1.1 and .net 2.0 (without
requiring a config file)? The dll I have runs fine under both, so I want it
to just work using whatever the exe that calls it is using.
 
David said:
How can I build a dll so it runs under both .net 1.1 and .net 2.0
(without requiring a config file)? The dll I have runs fine under
both, so I want it to just work using whatever the exe that calls it
is using.

I assume you have 1.1 and 2.0 installed on the same machine and are
using makefiles. If you use VS.NET to build your assembly then you
should use VS2003 to create the 1.1 version and VS2005 to create the 2.0
version.

If you use a makefile, or just invoke the compiler from the command
line, you just need to change the PATH so that it includes the
appropriate runtime folder so that the correct version of the compiler
is loaded (I also add a path to the SDK folder so that I can use the
other tools). If you pick up the compiler from the right folder it will
make sure that the right version of the framework is used to compile the
assembly. It's not a difficult thing to add to a makefile.

Richard
 
David said:
Hi;

How can I build a dll so it runs under both .net 1.1 and .net 2.0
(without requiring a config file)? The dll I have runs fine under
both, so I want it to just work using whatever the exe that calls it
is using.

then compile it on the command line with vbc or csc of .NET 1.1

FB

--
 
Hi;

Thanks for the answer. I'm definitely not clear on something here. I thought
when we compile/link out code it is tied to the strongly named assemblies we
link to. So if I build with .net 1.1 (what I am doing now), then it wants the
..net 1.1 and not the .net 2.0 dll.

What am I not understanding here?
 
David said:
Hi;

Thanks for the answer. I'm definitely not clear on something here. I
thought when we compile/link out code it is tied to the strongly
named assemblies we link to.

Yes, that's right.
So if I build with .net 1.1 (what I am
doing now), then it wants the .net 1.1 and not the .net 2.0 dll.
Yes.

What am I not understanding here?

Nothing. I wasn't being clear. You should compile your library twice:
once for 1.1 and then again for 2.0. It's not difficult to change your
make file to do this.

Richard
 
Oh, ok - that makes sense.

I was hoping there was a way to compile under 1.1 but mark it as ok for 2.0
also.

Since I have 2 files, is there a suggested naming for each? Like wr_1_1.dll
and wr_2_0.dll?
 
Hi

I think all is OK, that depends on your request.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top