Ask a Question related to ASP.NET General, Design and Development.
-
Jeff Ptak #1
How To: Read AssemblyInfo Attributes @ runtime
Hey all,
Can anyone show me the proper C# syntax necessary to read
the attribute fields from the AssemblyInfo.cs file? I
have the following in VB.Net, but so far am unsuccessful
in translating the code to C#:
Dim objCopyright As AssemblyCopyrightAttribute = CType
(AssemblyCopyrightAttribute.GetCustomAttribute
(System.Reflection.Assembly.GetExecutingAssembly, GetType
(AssemblyCopyrightAttribute)), AssemblyCopyrightAttribute)
Dim objProduct As AssemblyProductAttribute = CType
(AssemblyProductAttribute.GetCustomAttribute
(System.Reflection.Assembly.GetExecutingAssembly, GetType
(AssemblyProductAttribute)), AssemblyProductAttribute)
Thanks!
J. Ptak
Jeff Ptak Guest
-
#39467 [Opn]: Expaned Class members to allow setting of a read only value at runtime
ID: 39467 User updated by: kevin at metalaxe dot com Reported By: kevin at metalaxe dot com Status: Open Bug Type: ... -
#39467 [NEW]: Expaned Class members to allow setting of a read only value at runtime
From: kevin at metalaxe dot com Operating system: * PHP version: 5.2.0 PHP Bug Type: Feature/Change Request Bug description:... -
Changing CFINPUT attributes at RUNTIME
Hello All, I just figured out how to change the enabled feature of a text field in CFFORM based on a radio button. That was fairly simple. ... -
runtime error: memory can not be read
Hi all, The different behaviors of movies running in the director's authoring environment and runtime mode is nothing new. I can remember issues... -
Runtime CD query (not the simle read-only file question, but related)
I'm a newbie, publishing my first DB on CD for a client. The DB is large (several hundred Meg), so the client feels the main DB should stay (as... -
sampsons #2
Re: How To: Read AssemblyInfo Attributes @ runtime
I know the Visual Basic syntax for this
it uses the
System.Diagnostics.FileVersionInfo Class
Dim verInfo as System.Diagnostics.FileVersionInfo
verInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo( path as String)
then using the functions of verInfo you can get all information included in
the AssemblyInfo.vb File
Severin
"Jeff Ptak" <ptakja@NOSPAM.corning.com> wrote in message
news:065a01c34a1f$7cb9f870$a001280a@phx.gbl...> Hey all,
>
> Can anyone show me the proper C# syntax necessary to read
> the attribute fields from the AssemblyInfo.cs file? I
> have the following in VB.Net, but so far am unsuccessful
> in translating the code to C#:
>
> Dim objCopyright As AssemblyCopyrightAttribute = CType
> (AssemblyCopyrightAttribute.GetCustomAttribute
> (System.Reflection.Assembly.GetExecutingAssembly, GetType
> (AssemblyCopyrightAttribute)), AssemblyCopyrightAttribute)
>
> Dim objProduct As AssemblyProductAttribute = CType
> (AssemblyProductAttribute.GetCustomAttribute
> (System.Reflection.Assembly.GetExecutingAssembly, GetType
> (AssemblyProductAttribute)), AssemblyProductAttribute)
>
> Thanks!
>
> J. Ptak
>
sampsons Guest
-
Jeff Ptak #3
How To: Read AssemblyInfo Attributes @ runtime
Finally figured this out:
VB.NET Syntax:
Dim objCopyright As AssemblyCopyrightAttribute = CType
(AssemblyCopyrightAttribute.GetCustomAttribute
(System.Reflection.Assembly.GetExecutingAssembly, GetType
(AssemblyCopyrightAttribute)), AssemblyCopyrightAttribute)
C# Syntax:
AssemblyCopyrightAttribute objCopyright =
(AssemblyCopyrightAttribute)
AssemblyCopyrightAttribute.GetCustomAttribute
(System.Reflection.Assembly.GetExecutingAssembly() , typeof
(AssemblyCopyrightAttribute));
J. Ptak
>-----Original Message-----
>Hey all,
>
>Can anyone show me the proper C# syntax necessary to read
>the attribute fields from the AssemblyInfo.cs file? I
>have the following in VB.Net, but so far am unsuccessful
>in translating the code to C#:
>
>Dim objCopyright As AssemblyCopyrightAttribute = CType
>(AssemblyCopyrightAttribute.GetCustomAttribute
>(System.Reflection.Assembly.GetExecutingAssembl y, GetType
>(AssemblyCopyrightAttribute)), AssemblyCopyrightAttribute)
>
>Dim objProduct As AssemblyProductAttribute = CType
>(AssemblyProductAttribute.GetCustomAttribute
>(System.Reflection.Assembly.GetExecutingAssembl y, GetType
>(AssemblyProductAttribute)), AssemblyProductAttribute)
>
>Thanks!
>
>J. Ptak
>
>.
>Jeff Ptak Guest



Reply With Quote

