[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

How do I use Assembly.ImageRuntimeVersion

Drew

1/6/2003 9:37:00 PM

I am trying to write very simple code for an aspx page. I want to check
which version (1.0 or 1.1) of the runtime the app is executing on. I am
trying to return the Assembly.ImageRuntimeVersion property but cannot figure
out how to use it from a web application. Any help or sample code is
appreciated.

What I tried:

Assembly x = new Assembly();
Response.Write(x.ImageRuntimeVersion);

I get:

Build error: Assembly is inaccessble due to its protection level.

Thanks


4 Answers

Mattias Sjögren

1/6/2003 11:24:00 PM

0

Drew,

>I want to check which version (1.0 or 1.1) of the runtime the app is executing on.

You can check System.Environment.Version, that's somewhat easier.



Mattias

===
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.n...
Please reply only to the newsgroup.

Drew

1/7/2003 9:26:00 PM

0

Thats works. Thanks Mattias.

So what the heck is the Assembly.ImageRuntimeVersion property for ? (I
couldn't resist asking)

"Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message
news:#SAUeJdtCHA.2028@TK2MSFTNGP11...
> Drew,
>
> >I want to check which version (1.0 or 1.1) of the runtime the app is
executing on.
>
> You can check System.Environment.Version, that's somewhat easier.
>
>
>
> Mattias
>
> ===
> Mattias Sjögren [MVP] mattias @ mvps.org
> http://www.msjogren.n...
> Please reply only to the newsgroup.


(Mike Clay (MSFT))

1/7/2003 10:50:00 PM

0

They practically do the same thing.....return the CLR version. One
difference is ImageRuntimeVersion is supported only in version 1.1 where
System.Environment.Version is supported in both 1.0 and 1.1.

Mike Clay, MCSD
Beta Technical Support


This posting is provided "AS IS" with no warranties, and confers no rights.
© 2002 Microsoft Corporation. All rights reserved.

Mattias Sjögren

1/8/2003 12:22:00 AM

0

Drew & Mike,

>They practically do the same thing.....return the CLR version.

Yeah, but potentially different versions, so its not necessarily the
same thing. Environment.Version returns the CLR version loaded in the
process, Assembly.ImageRuntimeVersion returns the version the assembly
was built against. So if you load an assembly built against v1.0 in a
v1.1 app, you'll get different results.



Mattias

===
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.n...
Please reply only to the newsgroup.