At Pro 2.9 there was this great helper class that got info for your own addin. https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Content/AddInInfoManager
It bombs at 3.0 and I have not been able to locate an alternative API or other form of getting the info programmatically.
I tweaked the function and it turns out the the code is returning zero guid attributes:
public static string GetAddInGuid()
{
// get the GUID that identifies the current add-in
Assembly exAssembly = Assembly.GetExecutingAssembly();
//GuidAttribute gAttribute = (GuidAttribute)exAssembly.GetCustomAttributes(typeof(GuidAttribute), true)[0];
object[] custAtts = exAssembly.GetCustomAttributes(typeof(GuidAttribute), true);
if (custAtts.Length == 0)
{
throw new Exception("No custom attributes.");
}
GuidAttribute gAttribute = (GuidAttribute)custAtts[0];
// guid={903288ab-2c9c-4e49-8a3d-0321f68425c1}
return string.Format("{{{0}}}", gAttribute.Value);
}
Anyone know an alternative to programmatically get info for your own addin or just the GUID?