How do I programmatically get the GUID of an application in .net2.0

前端 未结 7 1073
囚心锁ツ
囚心锁ツ 2020-11-29 18:52

I need to access the assembly of my project in C# .NET2.0.

I can see the GUID in the \'Assembly Information\' dialog in under project properties, and at the moment

相关标签:
7条回答
  • 2020-11-29 19:38

    No luck here with the other answers but managed to work it out with this nice one liner:

    ((GuidAttribute)(AppDomain.CurrentDomain.DomainManager.EntryAssembly).GetCustomAttributes(typeof(GuidAttribute), true)[0]).Value
    

    Hope this helps!

    0 讨论(0)
提交回复
热议问题