Hi Gents,
I have found and read attentively quite a few related topics, but unfortunately none had a solution for my case:
I created a codeunit that reads emails from outlook in NAV 2015 using .NET variables. All works perfectly on the client, now I am trying to call it from the NAS.
Because it is being called from a server, I turned the RunOnClient property to
No.
And I get the error:
Cannot create an instance of the following .NET Framework object: assembly Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, type Microsoft.Office.Interop.Outlook.ApplicationClass.
I have installed office recently in the server, the DLLs in the client, service and GAC folders are all unblocked.
The code/variables that cause the error are:
CLEAR(Application);
Application := ApplicationClass.ApplicationClass();
where
[b]Application [/b] Microsoft.Office.Interop.Outlook.Application.'Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
[b]ApplicationClass [/b]Microsoft.Office.Interop.Outlook.ApplicationClass.'Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
I have redeclared and changed the variables to compiled them from scratch in this server after seeing some related issues in the forum but no good so far.
Any hint you can provide will be extremely helpful!
Thank you
Comments
probably this can help someone else, the answer to this was changing the service user to an user account with full permissions.
Now the same exact code gets a different error when running in the server:
"The type NavAutomation is unknown."
Do you know if this instance call has to be made any differently due to the fact it is being created in/by the server?
Thank you in advance
http://stackoverflow.com/questions/255669/how-to-enable-assembly-bind-failure-logging-fusion-in-net
http://www.hanselman.com/blog/BackToBasicsUsingFusionLogViewerToDebugObscureLoaderErrors.aspx
- create the registry keys
- restart your NAV service
- run your function
- stop your NAV service
- get yourself a cup of coffee and read through the fusion logs