I am experiencing a rather odd problem with NAS.
I developed a solution to queue reports to be printed as pdf (by BullZip) and then sent through NAS by email as attachments.
Environment is NAV2009 R2 SQL Client, running on SQL2005.
The Email hander code unit is SingleInstance = YES, and has the Navision Timer enabled to trigger every 60 seconds.
When I run the NAS connection through debug, the process executes as expected, ie all pdfs are created and sent via SMPT.
When I run NAS through the command prompt, leaving the dialogue box open, the code is still executed perfecctly.
BUT, as soon as I try and execute the handler from the installed service, it is as if the process gets stuck somewhere, never finishing.
There are no messages in the Event viewer.
For NAS, is have created a new local user name also called NAS and it belongs to the Admin group. I have also logged in physically with this new user name to ensure all windows profile settings are created especially for BullZip. The user is setup in NAV with Super permissions. Changing this to another existing account makes no difference.
The license in the App. Server folder is a developer's license.
Any suggestions or assistance would be appreciated, since I am currently stumped... :-k
0
Comments
Even no message about the NAS version?
Did you have a look at the System folder of the Event Viewer?
What I meant was, there are no errors...
I am running it now through the command prompt on the server, so far no issues.... but it HAS to word as a service....
Perhaps you could put in some messages to see how far your code is executed.
When I start NAS in debug mode and go through the code, there aren't any issues, the pdf's are created and the mail is sent, the same goes for running NAS from the command prompt.
Just some further info, I am using Expandit MailIt to attach the pdf's and email via SMTP. Works like a charm...normally.
I have been wondering if it couldn't be that there isn't enough "sleep" in the code to wait for the pdf to be created, but then, why would it work when running from the command prompt???
Thanks for your input! Much appreciated!
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
You are absolutely correct. I have determined that my problem lies with the ExpadIT MailIT OCX control. When NAS running as a service hits the first MailIT statement, it freezes... Now the question is whether it is a NAV bug, or ExpandIT... #-o
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I have the same problem, except that I am using an excel automation and when I call the function "ExportAsFixedFormat", the NAS (Service) is getting stuck. (Everything else matches rrvanzyl's description.)
Kind regards,
Alex
I traded my sanity for a railgun
Kind regards,
Alex
We guess that it has something to do with the Windows Profile of the service user. It's probably not fully loaded. At the moment we don't have any explanation why exactly it doesn't work. And it might become even more strange when I tell you that we've had another issue a couple of month ago where we setup something in the user profile of the service user and that works. So, it seems like the user profile is only partially loaded.
Do you know what your automation exactly wants to do? In our case it gets stuck when it tries to read from the registry.
thanks for the answer so far. To answer your questions:
Indeed.
I get the problem, if I use the function ExportAsFixedFormat from the excel workbook automation. The function should create a PDF document from the current workbook, but I am not really sure what excel does in the process.
BTW, would you mind telling me, what you changed in the profile?
Kind regards,
Alex
Yes, we set another proxy in internet options. That information is stored somewhere in the user settings and after we did that the issue disappeared. So, it looks like the user profile of the service user is loaded (or at least parts of it).
There is an option to allow services to use some kind of profile (http://msdn.microsoft.com/en-us/library/windows/desktop/ms683502(v=vs.85).aspx) but it's restricted to local system accounts which can't be used for NAV. There's a workaround (http://lostechies.com/keithdahlby/2011/08/13/allowing-a-windows-service-to-interact-with-desktop-without-localsystem/) but in my case that didn't work either.