How to get My Project Assembly GUID?

  • Thread starter Thread starter Rob R. Ainscough
  • Start date Start date
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?
 
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?
 
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.
 
Back
Top