PC Review


Reply
Thread Tools Rate Thread

How to compile for .net 1.1 & 2.0?

 
 
=?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=
Guest
Posts: n/a
 
      3rd Dec 2005
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.

--
thanks - dave
 
Reply With Quote
 
 
 
 
Richard Grimes
Guest
Posts: n/a
 
      4th Dec 2005
David Thielen wrote:
> 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
--
http://www.grimes.demon.co.uk/workshops/fusionWS.htm
http://www.grimes.demon.co.uk/workshops/securityWS.htm


 
Reply With Quote
 
Frans Bouma [C# MVP]
Guest
Posts: n/a
 
      4th Dec 2005
David Thielen wrote:

> 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

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
Reply With Quote
 
=?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=
Guest
Posts: n/a
 
      4th Dec 2005
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?

--
thanks - dave


"Richard Grimes" wrote:

> David Thielen wrote:
> > 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
> --
> http://www.grimes.demon.co.uk/workshops/fusionWS.htm
> http://www.grimes.demon.co.uk/workshops/securityWS.htm
>
>
>

 
Reply With Quote
 
Richard Grimes
Guest
Posts: n/a
 
      5th Dec 2005
David Thielen wrote:
> 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
--
http://www.grimes.demon.co.uk/workshops/fusionWS.htm
http://www.grimes.demon.co.uk/workshops/securityWS.htm


 
Reply With Quote
 
=?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=
Guest
Posts: n/a
 
      5th Dec 2005
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?

--
thanks - dave


"Richard Grimes" wrote:

> David Thielen wrote:
> > 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
> --
> http://www.grimes.demon.co.uk/workshops/fusionWS.htm
> http://www.grimes.demon.co.uk/workshops/securityWS.htm
>
>
>

 
Reply With Quote
 
Peter Huang [MSFT]
Guest
Posts: n/a
 
      6th Dec 2005
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile versus not compile (VS 2005)?? stupid48@gmail.com Microsoft ASP .NET 1 11th Apr 2008 09:24 PM
Why did this compile? John A. Bailo Microsoft Dot NET 5 15th Apr 2006 08:21 PM
VBAProject name compile error, not defined at compile time Matthew Dodds Microsoft Excel Programming 1 13th Dec 2005 07:17 PM
can i fine tune VS.Net compile/ use parallel process when compile? norton Microsoft Dot NET 0 1st May 2004 07:09 PM
Using vbc to compile =?Utf-8?B?RmF0Ym95Q2FudGVlbg==?= Microsoft Dot NET Framework Forms 1 13th Feb 2004 12:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:59 PM.