VB.Net Windows Service Issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sayona76
    New Member
    • Nov 2008
    • 5

    VB.Net Windows Service Issue

    Hello Everyone,

    I am stuck with a minor issue related to a Windows Service made in VB.Net (framework 2.0). The service is working as expected for few printing documents and not for others.

    The actual expectation for Windows Service is to periodically check for new Work Orders raised and print the respective WorkOrder (MS-Word) document on a predefined network printer. This is done perfectly fine, barring few word documents and I am not sure for what reason. Let me know in case if you would like to have more information to help me.

    Regards,
    Saurabh
  • balabaster
    Recognized Expert Contributor
    • Mar 2007
    • 798

    #2
    A concurrency issue maybe? Can you obtain an exclusive lock on the files?

    I mean, really, there could be any number of issues, but assuming you've chased down the obvious ones like: is the file in the right place, does the code have a bug, is the service enumerating all the files correctly etc:

    It maybe that printing is never attempted for these files... I could sit here and postulate all day long as to what might be the issue. Make sure you've checked the obvious things and get back to us...

    Comment

    • PRR
      Recognized Expert Contributor
      • Dec 2007
      • 750

      #3
      Put your code in try catch block and write to a file in catch block .. that way you will know if there is any exceptions... and let us know more ...:)

      Comment

      • sayona76
        New Member
        • Nov 2008
        • 5

        #4
        Originally posted by balabaster
        A concurrency issue maybe? Can you obtain an exclusive lock on the files?

        I mean, really, there could be any number of issues, but assuming you've chased down the obvious ones like: is the file in the right place, does the code have a bug, is the service enumerating all the files correctly etc:

        It maybe that printing is never attempted for these files... I could sit here and postulate all day long as to what might be the issue. Make sure you've checked the obvious things and get back to us...
        I have checked the guesses you mentioned. I have maintained the event log, but it does not throw any error. the method document.printo ut is used where document is an object (automation server) for Word (2000) document class. the same method prints few documents and not others. The strange point here is that it spools all pages when printed using a loop for the number of pages in document, but it still does not print from the queue. And when I print the whole document it does not go beyond a certain page. Since this is happening for only selected few documents, i m not able to trace the issue.

        Let me know in case if you would like to have more information to help me.

        Comment

        • PRR
          Recognized Expert Contributor
          • Dec 2007
          • 750

          #5
          "periodical ly check for new Work Orders raised and print the respective WorkOrder (MS-Word) document on a predefined network printer."
          System.Timers.T imer? which timer are you using?
          Does it have any dependency?(wit h other service?)
          Also are you using threading for processing?

          Comment

          Working...