Posting to Server Event Log from Referenced .NET Class

Home Page Forums BizTalk 2004 – BizTalk 2010 Posting to Server Event Log from Referenced .NET Class

Viewing 2 reply threads
  • Author
    Posts
    • #25120

      Greetings!

      Wish all the best.

      I have built a .NET helper class that is referenced by my orchestration.  I wanted it to post to the event log for diagnostic reasons.  The orchestration itself has no problem posting to the log from an msg-asgnment shape – but the class can’t.  The class works just fine and performs it helper function so I know it was lit up.  No errors are thrown (that I could find) except occasionally an MSMQ permission error that made no sense to me as I was not using MSMQ.  I think I fixed that though.

      I know the code works – I took it out of some other working .NET projects.  And, the intelisense works when I code the helper class.  I am wondering some scope thing or something.

      Here is the code

       

       

       

       

       

      If 

       

      Not EventLog.SourceExists(“DOH_IES HelperClass”) Then

      EventLog.CreateEventSource(“DOH_IES HelperClassP”, “Application”)

       

       

      End If

       

       

      Dim myLog As New  EventLog()

      myLog.Source =

      “DOH_IES HelperClass”

      myLog.WriteEntry(

      “HelperClass Fired Up”, “We got into the class”, EventLogEntryType.Information)

    • #25129

      Weird how the webpage messes up the formatting of the code 🙁

      • #25131

        OK – time for eating crow.  I restarted the box and now it works.  i guess something was cached.  But what?  I had started and stopped BizTalk several times and also stopped and started the host instance.  Refreshed and restarted several times.  So, it may be somewhere else in the OS that this was cached?

        So – it works – if for no other reason than by accident.  Well, at least I know I can still VB code 🙂

    • #50224
      biztalkgurus

        You Are the First Kid on Mars · Patrick O’Brien · 9780399246340

    Viewing 2 reply threads
    • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.