473,387 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How can I access AssemblyVersionAttribute in AssemblyInfo.cpp

I tried a few more thing.

I found that I can access the AssemblyInfo.cpp like follows.(This is
from the VS help system.)

Type^ clsType = Form1::typeid;
Assembly^ assy = clsType->Assembly;

AssemblyProductAttribute^ apAttr =
dynamic_cast<AssemblyProductAttribute^>(Attribute: :GetCustomAttribute(assy,

AssemblyProductAttribute::typeid));

AssemblyVersionAttribute^ avAttr =
dynamic_cast<AssemblyVersionAttribute^>(Attribute: :GetCustomAttribute(assy,

AssemblyVersionAttribute::typeid));

MessageBox::Show(apAttr->Product + L" " + avAttr->Version);

This code works well with AssemblyProductCode, ... and all only except
AssemblyVersionAttribute.
avAttr always gets nothing.

Do you have any idea on this?
I spend a lot of time for this meaningless thing. ;-(
Dec 13 '05 #1
2 4306
"Eddie" <ed******@gmail.com> wrote
This code works well with AssemblyProductCode, ... and all only except
AssemblyVersionAttribute.
avAttr always gets nothing.

AssemblyVersionAttribute is a pseudo custom attribute (well,
strictly speaking, it is not exactly but I behaves like one)

When emitted to the metadata representation, they are
not emitted as custom attributes but are rather translated to
specialized constructions.

To access the information use the special APIs. For
AssemblyVersion use assy->GetName()->Version.

-hg
Dec 13 '05 #2
Thank you very much, HG.

Now, I can get the version info.
Thanks.

Holger Grund wrote:
"Eddie" <ed******@gmail.com> wrote

This code works well with AssemblyProductCode, ... and all only except
AssemblyVersionAttribute.
avAttr always gets nothing.


AssemblyVersionAttribute is a pseudo custom attribute (well,
strictly speaking, it is not exactly but I behaves like one)

When emitted to the metadata representation, they are
not emitted as custom attributes but are rather translated to
specialized constructions.

To access the information use the special APIs. For
AssemblyVersion use assy->GetName()->Version.

-hg

Dec 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: | last post by:
Hi, In the AssemblyInfo.cs file I change the AssemblyVersion; attribute from the default "1.0.*" blah I notice that its FORCING 4 digit notation, so if I use "1.0.0" I get "1.0.0.0" in that...
1
by: Robert Scheer | last post by:
Hi. I tried to compile a windows forms app without the assemblyinfo.vb file, and it compiled ok. So, if I delete the assemblyinfo.vb file from my project what kinds of problems would I have? ...
2
by: MrNobody | last post by:
I'm trying to figure out how to handle versioning for my app when I found a web site talking about AssemblyInfo.cs. They say all new .NET projects get this file and it comes with automated...
7
by: Zdenko | last post by:
Hi all, I have following line in AssemblyInfo.cpp file: ; When I build managed application, FileVersion column in Windows explorer is empty. When I build C# dll, it is displayed correctly.
0
by: Siew Fai | last post by:
hi All, In the documentation ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfSystemReflect ionAssemblyVersionAttributeClassTopic.htm there is a sentence "A version number such as...
4
by: Phil Galey | last post by:
I created an About box and am able to get all the assembly information from the program to show up in the About box except the Version. I created the About box as a separate Windows application,...
0
by: sovarschizsuzsa | last post by:
Hy everybody! I would like to set the AssemblyVersionAttribute fourth part from a given parameter. My project is compiled with a makefile, so this parameter becomes value through this makefile....
2
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...
0
by: The Coder | last post by:
I get a version tab in the shell only for VS_VERSION_INFO. I was expecting AssemblyInfo.cpp to create the version tab . Can I get AssemblyInfo.cpp to create version tab instead? If can not get...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.