Unable to load XXXX Add-In. Index was outside the bounds of the array.
I have generated MS Visio Add-In and installed it. When loading the Visio 2016, I'm getting error 'Unable to load the XXXX Add-In. Index was outside the bounds of the Array', and the Add-In is not loaded in the Visio.
I have installed Visio 2016 MSO (64-bit, version 16.0.4738.1000) and Visual Studio 2010 (64-bit, version 10.0.40219.1 SP1Rel) on a Windows 7 Professional (64-bit, version 6.1.7601)
Please help me to resolve this.
Code snippet :
public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom) { try { mapXMLToVisio = new MyMapXMLToMicrosoftVisio(); applicationObject = application; this.visioApplication = applicationObject as Microsoft.Office.Interop.Visio.Application; addInInstance = addInInst; } catch (Exception e) { MessageBox.Show("Unable to load the XXXX Add-in: " + e.Message); } }