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 4 11809
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" <pt****@NOSPAM.corning.com> wrote in message
news:06****************************@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
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" <pt****@NOSPAM.corning.com> wrote in message
news:06****************************@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
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
.
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
. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Fred Iannon |
last post by:
All,
I am trying to figure out a clean solution to the
following issues:
(1) - We have a number of dlls/exes that need to have
the same "values" for the various assembly attributes
(like...
|
by: c8prog |
last post by:
I'm using dotnetframework 1.1.
By the way, I don't know how to read the information of AssemblyInfo.cs file.
I wish to read it.
The following Example Files.
File 1: AssemblyInfo.cs
using...
|
by: Sec_Newbie |
last post by:
Why do I never see any intellisense from VS.NET (2003), when in AssemblyInfo.cs file?
The below is my file with all the using statements that should at least present intellisense for...
|
by: Jeff Ptak |
last post by:
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...
|
by: Rob |
last post by:
What VB run-time methods are available to retrieve
information (such as AssemblyCopyright, AssemblyProduct,
AssemblyVersion, etc.) from the AssemblyInfo.vb file for
the current executable?
...
|
by: xenophon |
last post by:
In my 1.1 ASP.NET project, AssemblyInfo.cs had custom information
about versioning and etc. With 2.0, I made an AssemblyInfo.cs in the
root of my site, but with all of the multiple DLLs it appears...
|
by: Dragon |
last post by:
What is the use of AssemblyInfo.cs
|
by: James Wong |
last post by:
Hi everybody,
I would like to know how to retrieve information from AssemblyInfo.vb inside
web service. I've tried many different ways including GetExecutingAssembly
or similar method but all...
|
by: Water Cooler v2 |
last post by:
Who uses the AssemblyInfo.cs file? How is it used?
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |