Visual studio crash when registering add-in project to outlook

Add-in Express™ Support Service
That's what is more important than anything else

Visual studio crash when registering add-in project to outlook
 
Henk Beekhuis




Posts: 4
Joined: 2015-12-02
When registering add-in project to outlook visual studio crashes.
Configuration : debug/Any CPU


Visual studio 2015 Pro
Office 2016
adxnet-v800-b4330-vs-std
Posted 02 Dec, 2015 18:26:29 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Henk,

I assume the issue doesn't occur on a newly created add-in project with no custom code. Please confirm.

Would it happen if you comment out the custom code in the constructor of the add-in module? Also, if you initialize class-level complex-type variables in the add-in module, change them as follows:

MySuperDuperType myVariable = null; --> MySuperDuperType myVariable;

Then initialize such variables in an event of the add-in module (not in the constructor).

Does this help?


Andrei Smolin
Add-in Express Team Leader
Posted 03 Dec, 2015 03:59:26 Top
Henk Beekhuis




Posts: 4
Joined: 2015-12-02
Hello Andrei, thanks for your help.

You are right about the following facts :
Newly created add-in project goes ok, commenting out initialization code works as well.

The thing is that i like to initialize a dataLayer by using a static method on a static DBInit object in my datalayer assembly. The reason i would like to do it with static object is obviously to keep things in memory. I am using a Task based initialization so everything runs on separate thread. Probably not the best way to get initialization done but in separate winform test project works quite well.
Posted 03 Dec, 2015 10:49:42 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Henk,

The add-in module may be created outside of the host application; in particular, this occurs when you register/unregister your add-in. I suppose your code isn't prepared to this, it generates an exception and this crashes the IDE.

Also, the host application controls your add-in by triggering methods of the COM interfaces your add-in must support; these methods are mapped to the events of the add-in module. In a standalone application you dictate rules of your own; in an add-in you must follow the rules of the host application.


Andrei Smolin
Add-in Express Team Leader
Posted 04 Dec, 2015 03:30:05 Top