|
BerndH
Posts: 116
Joined: 2014-09-23
|
Hi,
I have some code that's causing a new error: without the code, my add-in starts perfectly. With the code, I get an error. I've set a breakpoint, but I'm not hitting it. I've also set a breakpoint in the `public AddinModule()` function in the first line, but I'm not hitting that one either: the error message from my code appears earlier.
Could you describe how the add-in is started in Outlook, or what happens before the `AddinModule` function?
Bernd |
|
|
Andrei Smolin
Add-in Express team
Posts: 19218
Joined: 2006-05-11
|
Hello Bernd,
Make sure your add-in loads at all: when Office loads your add-in, adxloader.log is updated.
I suppose your code is invoked before the constructor is run. Say, you have a class-level variable of a complex type and that variable has an initializer e.g. it is set to null. You should remove such initializers and initialize such variables in the following method:
protected override void OnHostApplicationInitialized()
{
base.OnHostApplicationInitialized();
// your code here
}
This method is called when Add-in Express obtains the Application object of your add-in's host application. This is the point where your add-in's life starts.
Regards from Poland (GMT+1),
Andrei Smolin
Add-in Express Team Leader |
|