Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old September 4th, 2008, 06:35 AM
cristalink
Guest
 
Posts: n/a
Default A tool to view C++/CLI assembly attributes

Hi,

I have a C++/CLI DLL which I marked with [assembly:
AssemblyVersionAttribute( "1.0.0.0" )] in a cpp file. Is there a standard
tool from Microsoft that takes a .DLL file and displays all the .NET
attributes of the assembly?

Thanks,

John

  #2  
Old September 4th, 2008, 07:25 AM
Pavel Minaev
Guest
 
Posts: n/a
Default Re: A tool to view C++/CLI assembly attributes

"cristalink" <cristalink@noemail.noemailwrote in message
news:%23BDfG8kDJHA.4428@TK2MSFTNGP06.phx.gbl...
Quote:
Hi,
>
I have a C++/CLI DLL which I marked with [assembly:
AssemblyVersionAttribute( "1.0.0.0" )] in a cpp file. Is there a standard
tool from Microsoft that takes a .DLL file and displays all the .NET
attributes of the assembly?
ildasm.exe will do that (aside from anything else it does).


  #3  
Old September 4th, 2008, 11:35 AM
Jialiang Ge [MSFT]
Guest
 
Posts: n/a
Default RE: A tool to view C++/CLI assembly attributes

Good morning John. Welcome to Microsoft Newsgroup Support service! My name
is Jialiang Ge [MSFT]. It's my pleasure to work with you on this issue.

As Pavel mentioned, ildasm.exe (MSIL Disassembler) is one standard tool
from Microsoft that can view all the .NET attributes of an assembly. You
can find it in .NET Framework SDK.

MSIL Disassembler (Ildasm.exe)
http://msdn.microsoft.com/en-us/libr...k1(VS.80).aspx

Ildasm.exe Tutorial (this tutorial is for .NET 1.1, but it also works for
.NET 2.0 and later)
http://msdn.microsoft.com/en-us/library/aa309387.aspx

In the menu File->Open of ildasm, we could locate the C++/CLI dll, load it.
Then in the View menu -MetaInfo -Show!, it would display all the
metadata info in the .NET assembly, including our AssemblyVersionAttribute
("1.0.0.0"):

CustomAttribute #7 (0c000043)
-------------------------------------------------------
CustomAttribute Type: 0a000005
CustomAttributeName: System.Reflection.AssemblyVersionAttribute :: instance
void .ctor(class System.String)
Length: 12
Value : 01 00 07 31 2e 30 2e 30 2e 30 00 00 1.0.0.0 <
ctor args: ("1.0.0.0")

One thing to be noticed is that, although most attributes in AssemblyInfo
can be found in the manifest, AssemblyVersionAttribute is an exception.
Compilers emit specific metadata for AssemblyVersionAttribute, rather than
emiting the custom attributes themselves. For more details, see the article:
http://blogs.msdn.com/adam_nathan/ar.../29/56645.aspx

John, please try it and let us know whether it's helpful to you.

Apart from ildasm, I'd like to share some other useful resources with you
to look at whenever you find free time. You might have come across these
before but it is just for your reference.

1. A commonly used tool: .NET Reflector
http://www.red-gate.com/products/reflector/
The original writer of the tool, Lutz Roeder, is a Microsoft engineer. In
the recent days, he declared to transfer the development of the tool to Red
Gate: http://blog.lutzroeder.com/

.NET Reflector can easily disassemble any .NET assembly. You could see the
AssemblyVersionAttribute["1.0.0.0"] by loading the .NET assembly,
right-clicking on the resultant node in reflector, and choose "Disassemble".

2. Assembly Viewer
http://www.codeproject.com/KB/dotnet/asmex.aspx
An open source solution to view the .NET assembly metadata. It contains the
source code to parse a .NET assembly.

3. PEBrowsePro
http://www.smidgeonsoft.prohosting.com/
PEBrowsePro can not only analyze .NET meta, it also does a very good job to
parse native images.

And more...

In addition, if you are interested in how to do the above programmatically
in future, you may want to have a look at this online book:
http://www.vijaymukhi.com/documents/books/metadata/
or refer to the source code in Assembly Viewer
http://www.codeproject.com/KB/dotnet/asmex.aspx

Have a nice day!

Regards,
Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


  #4  
Old September 4th, 2008, 09:35 PM
cristalink
Guest
 
Posts: n/a
Default Re: A tool to view C++/CLI assembly attributes

Thank you for the replies. Ildasm is OK for me.

Cheers,

John



"cristalink" <cristalink@noemail.noemailwrote in message
news:%23BDfG8kDJHA.4428@TK2MSFTNGP06.phx.gbl...
Quote:
Hi,
>
I have a C++/CLI DLL which I marked with [assembly:
AssemblyVersionAttribute( "1.0.0.0" )] in a cpp file. Is there a standard
tool from Microsoft that takes a .DLL file and displays all the .NET
attributes of the assembly?
>
Thanks,
>
John
>
 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles