How to make my GUID visible to a VSTO add-in

I tried to add the following code at the beginning of my add-in code as such:

Namespace NS [Guid("211B3945-E2AE-48DD-8A9A-77ADB40EC6D5")] [ComVisible(true)] public partial class Classname { 

but it does not appear when I list COMAddins (this is a name but not a GUID).

I also tried to set it in my compilation settings according to Assembly information without any luck.

BTW - the problem I'm trying to solve is to see if the COM addon is loaded looking for its GUID. The Addin description appears when I check the ComAddIns list, but the GUID still shows zeros no matter how I follow these directions. I am trying to see what is visible using the following code:

 olApp = this.Application; Office.COMAddIns CAIs = olApp.COMAddIns; foreach (Office.COMAddIn CAI in CAIs) { StringBuilder sb = new StringBuilder(); sb.AppendLine(CAI.Description); sb.AppendLine(CAI.Guid); sb.AppendLine("****"); Debug.Print(sb.ToString()); } 
+6
source share
1 answer

There are several drawbacks to exposing COM, including overriding RequestComAddInAutomationService and setting [InterfaceType(ComInterfaceType.InterfaceIsDual)]

See the following items:

0
source

Source: https://habr.com/ru/post/899235/


All Articles