Exception is missing in adxloader.log

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

Exception is missing in adxloader.log
 
thiede




Posts: 40
Joined: 2016-07-05
Hi,

I get an error on initializing my Add-In.
In the log I get the error:
Exception has been thrown by the target of an invocation. Error code: 0x80131604.
But why is the exception not shown?

Greets from Berlin
Christopher
Posted 07 Apr, 2017 05:03:27 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello Christopher,

Mmm, I can't answer your question. Probably, the exception is handled in this way.

Could you please post the log here or send it to the support email address?


Andrei Smolin
Add-in Express Team Leader
Posted 07 Apr, 2017 05:22:03 Top
thiede




Posts: 40
Joined: 2016-07-05
Hi, I solved my current problem. It was very simple. But if I had the exception message and stacktrace in the adxloader.log I would have found it faster.
Posted 07 Apr, 2017 06:32:30 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Christopher,

Should the exception be generated in managed code you'd get a call stack. This isn't possible with an exception in adxaloader.dll which is an ummanaged DLL.


Andrei Smolin
Add-in Express Team Leader
Posted 07 Apr, 2017 06:53:21 Top
thiede




Posts: 40
Joined: 2016-07-05
And is it possible to get the exception message without stacktrace?
Posted 07 Apr, 2017 07:02:15 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
When your program calls a WinAPI method, the resulting value is an HRESULT. You can translate it to the corresponding message using resources external to the program. Say, you can use Google to get the message text in the preferred language.


Andrei Smolin
Add-in Express Team Leader
Posted 07 Apr, 2017 07:27:53 Top
thiede




Posts: 40
Joined: 2016-07-05
In my case the problem was in AddinInitialize on

NLog.LogManager.GetCurrentClassLogger();

It throws an exception. Could you catch this exception and show the message in the adxloader.log? This would be very helpful.
Posted 07 Apr, 2017 08:08:26 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
adxloader creates the module; it doesn't call any event on the module. AddinIntialize is called by Office. This occurs far outside of the loading process that the loader performs.


Andrei Smolin
Add-in Express Team Leader
Posted 07 Apr, 2017 08:28:52 Top
thiede




Posts: 40
Joined: 2016-07-05
I think you go around me. :/

If e.g. the C# constructor of my Add-In throws an exception why is this exception (message) not shown in the adxloader.log. There is only the error code. And this error code doesn't help.
Posted 07 Apr, 2017 08:46:30 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
The code in the initial post at http://stackoverflow.com/questions/6477155/c-loading-a-dll-into-the-default-appdomain resembles what adxloader does. The point is: the last method called in that code is only able to return an HRESULT. This is why Add-in Express doesn't provide a code stack in your situation.


Andrei Smolin
Add-in Express Team Leader
Posted 07 Apr, 2017 09:23:20 Top