Monday, October 24, 2011

Reflection | Get Assembly's GUID for Current DLL Build

Problem:
Get the Hash/Guid (unique value) of the running assembly, in runtime.

Solution: string myguid = Assembly.GetExecutingAssembly().GetModule("MyAssembly.dll").ModuleVersionId.ToString();

Result: 143afb59-6b87-4e8b-a187-74b57fdd3b5d

No comments:

Post a Comment