How to get My Project Assembly GUID?

R

Rob R. Ainscough

I tried the following and it does provide a GUID, but not the GUID listed in
the My Project ... Assembly Info button.

Dim myAss As [Assembly]
myAss = [Assembly].GetEntryAssembly
Dim myAssGUID As System.Guid = myAss.ManifestModule.ModuleVersionId
Dim myStringGUID As String = myAssGUID.ToString

tried using GetCallingAssembly, GetExecutingAssembly and none of them
reprsent the GUID listed under My Project | Application | Assembly
Information button

Any suggestions on how to get that specific GUID value?
 
S

Siva M

Attribute[] attrb = (Attribute[])
(Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(System.Runtime.InteropServices.GuidAttribute),
true));
Console.WriteLine
(((System.Runtime.InteropServices.GuidAttribute)(attrb[0])).Value);

Hope this helps?

I tried the following and it does provide a GUID, but not the GUID listed in
the My Project ... Assembly Info button.

Dim myAss As [Assembly]
myAss = [Assembly].GetEntryAssembly
Dim myAssGUID As System.Guid = myAss.ManifestModule.ModuleVersionId
Dim myStringGUID As String = myAssGUID.ToString

tried using GetCallingAssembly, GetExecutingAssembly and none of them
reprsent the GUID listed under My Project | Application | Assembly
Information button

Any suggestions on how to get that specific GUID value?
 
R

Rob R. Ainscough

Thanks for the response,

No, it doesn't return the GUID identified in the My Project for my startup
project in my solution. It gets the GUID for the currently executing
assembly which is not the same GUID. No documentation I've found that can
get this GUID -- the mystery GUID from Microsoft inaccessible under managed
code.

Rob.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top