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 / New Users / August 2005

Tip: Looking for answers? Try searching our database.

How to control what framework version is used for an assembly?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve Franks - 30 Jul 2005 19:28 GMT
Is there an option within Visual Studio where you tell it what version of
the framework you are targetting?

I'd like to use Visual Studio 2005 to compile my assembly (C# class
library), but I want to to tell VS that I want my compiled assembly to work
with the original 1.0 framework, and then have it produce an assembly that
will run in that environment ok, and warn me if at any time I use a class or
other function that is not available under my target framework.  Is this
possible?

In other words, I am trying to build an assembly that is compatible with all
versions of the .NET framework, but I want to use Visual Studio 2005 to
compile it?  By using VS 2005 and I automatically forcing my assembly to
require the .NET framework 2.0 - even if I am using just generic .NET code
that is compatible with .NET 1.0?

The bottom line is that I am not using any special features of the later
frameworks.  I want to use the latest VS 2005 to compile, but yet make sure
the assembly works with framework 1.0.  How can this be done?

Thanks,

Steve
Mattias Sjögren - 01 Aug 2005 07:48 GMT
>I'd like to use Visual Studio 2005 to compile my assembly (C# class
>library), but I want to to tell VS that I want my compiled assembly to work
>with the original 1.0 framework, and then have it produce an assembly that
>will run in that environment ok, and warn me if at any time I use a class or
>other function that is not available under my target framework.  Is this
>possible?

Officially no, but have a look at
http://weblogs.asp.net/rmclaws/archive/2005/06/04/410360.aspx

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Steve Franks - 01 Aug 2005 13:05 GMT
Thank you. I was hoping there was a way to create a 2.0 framework assembly,
but have it automatically still run within earlier versions of the framework
if 2.0 was not available.  Seems feasable if one stays away from 2.0
specific functionality when coding, but I guess not.

Steve

>>I'd like to use Visual Studio 2005 to compile my assembly (C# class
>>library), but I want to to tell VS that I want my compiled assembly to
[quoted text clipped - 9 lines]
>
> Mattias
Mattias Sjögren - 01 Aug 2005 15:05 GMT
>Thank you. I was hoping there was a way to create a 2.0 framework assembly,
>but have it automatically still run within earlier versions of the framework
>if 2.0 was not available.  Seems feasable if one stays away from 2.0
>specific functionality when coding, but I guess not.

Unfortunately not, all the v2 compilers produce metadata that the
older runtimes don't understand.

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.


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.