PC Review


Reply
Thread Tools Rate Thread

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

 
 
Steve Franks
Guest
Posts: n/a
 
      30th Jul 2005
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


 
Reply With Quote
 
 
 
 
Mattias Sjögren
Guest
Posts: n/a
 
      1st Aug 2005

>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/archi...04/410360.aspx



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
 
Reply With Quote
 
Steve Franks
Guest
Posts: n/a
 
      1st Aug 2005
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

"Mattias Sjögren" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
>>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/archi...04/410360.aspx
>
>
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.



 
Reply With Quote
 
Mattias Sjögren
Guest
Posts: n/a
 
      1st Aug 2005

>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

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
 
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
How to detect .NET Framework version of an Assembly Hayato Iriumi Microsoft Dot NET 1 13th May 2008 12:18 AM
Determine Assembly's .NET Framework Version Z D Microsoft Dot NET Framework 11 7th May 2004 06:17 PM
Determine Assembly's .NET Framework Version Z D Microsoft VB .NET 11 7th May 2004 06:17 PM
Determine Assembly's .NET Framework Version Z D Microsoft C# .NET 11 7th May 2004 06:17 PM
Determine Framework version from assembly Scott Microsoft VB .NET 2 5th Feb 2004 02:18 PM


Features
 

Advertising
 

Newsgroups
 


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