Create dll for EventViewer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Podmore

    Create dll for EventViewer

    When I perform: EventLog.WriteE ntry(strSource, strEntry,
    EventLogEntryTy pe.Error, intEventID)

    The event viewer reports

    The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le ) cannot
    be found. The local computer may not have the necessary registry information
    or message DLL files to display messages from a remote computer.

    I think I need to create a dll that returns error messages for event ID’s.
    Can this dll be written in VB.NET?
    Any pointers to documentation that tells me how to go about creating this dll?

    Or am I missing something and have got it totally wrong?

    Thanks in advance.
    Chris.
  • steve

    #2
    Re: Create dll for EventViewer

    you need to see if the source exists and create it if it doesn't...then
    write to it:

    public shared sub LogEvent(byval Source as string, byval Message as string,
    byval Type as eventlogentryty pe)
    dim eventLog as new system.diagnost ics.eventlog
    try
    if not eventLog.Source Exists(Source) then
    eventLog.Create EventSource(Sou rce, "Log Name Here")
    eventLog.Log = "Log Name Here"
    eventLog.WriteE ntry(Source, Message, Type)
    catch ex as Exception
    throw new ApplicationExce ption(ex.messag e, ex.innerexcepti on)
    end try
    end sub

    hth,

    steve


    "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
    news:CDF28C12-4735-41B9-A3D5-0A65B2BF4F38@mi crosoft.com...
    | When I perform: EventLog.WriteE ntry(strSource, strEntry,
    | EventLogEntryTy pe.Error, intEventID)
    |
    | The event viewer reports
    |
    | The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le )
    cannot
    | be found. The local computer may not have the necessary registry
    information
    | or message DLL files to display messages from a remote computer.
    |
    | I think I need to create a dll that returns error messages for event ID's.
    | Can this dll be written in VB.NET?
    | Any pointers to documentation that tells me how to go about creating this
    dll?
    |
    | Or am I missing something and have got it totally wrong?
    |
    | Thanks in advance.
    | Chris.


    Comment

    • steve

      #3
      Re: Create dll for EventViewer

      you need to see if the source exists and create it if it doesn't...then
      write to it:

      public shared sub LogEvent(byval Source as string, byval Message as string,
      byval Type as eventlogentryty pe)
      dim eventLog as new system.diagnost ics.eventlog
      try
      if not eventLog.Source Exists(Source) then
      eventLog.Create EventSource(Sou rce, "Log Name Here")
      eventLog.Log = "Log Name Here"
      eventLog.WriteE ntry(Source, Message, Type)
      catch ex as Exception
      throw new ApplicationExce ption(ex.messag e, ex.innerexcepti on)
      end try
      end sub

      hth,

      steve


      "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
      news:CDF28C12-4735-41B9-A3D5-0A65B2BF4F38@mi crosoft.com...
      | When I perform: EventLog.WriteE ntry(strSource, strEntry,
      | EventLogEntryTy pe.Error, intEventID)
      |
      | The event viewer reports
      |
      | The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le )
      cannot
      | be found. The local computer may not have the necessary registry
      information
      | or message DLL files to display messages from a remote computer.
      |
      | I think I need to create a dll that returns error messages for event ID's.
      | Can this dll be written in VB.NET?
      | Any pointers to documentation that tells me how to go about creating this
      dll?
      |
      | Or am I missing something and have got it totally wrong?
      |
      | Thanks in advance.
      | Chris.


      Comment

      • Chris Podmore

        #4
        Re: Create dll for EventViewer

        I know about checking if the source exists. It does and that's how I actually
        manage to get enties in the event log. What I want to do is stop the "The
        description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le ) cannot be
        found" message for my entries in the event viewer.

        "steve" wrote:
        [color=blue]
        > you need to see if the source exists and create it if it doesn't...then
        > write to it:
        >
        > public shared sub LogEvent(byval Source as string, byval Message as string,
        > byval Type as eventlogentryty pe)
        > dim eventLog as new system.diagnost ics.eventlog
        > try
        > if not eventLog.Source Exists(Source) then
        > eventLog.Create EventSource(Sou rce, "Log Name Here")
        > eventLog.Log = "Log Name Here"
        > eventLog.WriteE ntry(Source, Message, Type)
        > catch ex as Exception
        > throw new ApplicationExce ption(ex.messag e, ex.innerexcepti on)
        > end try
        > end sub
        >
        > hth,
        >
        > steve
        >
        >
        > "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
        > news:CDF28C12-4735-41B9-A3D5-0A65B2BF4F38@mi crosoft.com...
        > | When I perform: EventLog.WriteE ntry(strSource, strEntry,
        > | EventLogEntryTy pe.Error, intEventID)
        > |
        > | The event viewer reports
        > |
        > | The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le )
        > cannot
        > | be found. The local computer may not have the necessary registry
        > information
        > | or message DLL files to display messages from a remote computer.
        > |
        > | I think I need to create a dll that returns error messages for event ID's.
        > | Can this dll be written in VB.NET?
        > | Any pointers to documentation that tells me how to go about creating this
        > dll?
        > |
        > | Or am I missing something and have got it totally wrong?
        > |
        > | Thanks in advance.
        > | Chris.
        >
        >
        >[/color]

        Comment

        • Chris Podmore

          #5
          Re: Create dll for EventViewer

          I know about checking if the source exists. It does and that's how I actually
          manage to get enties in the event log. What I want to do is stop the "The
          description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le ) cannot be
          found" message for my entries in the event viewer.

          "steve" wrote:
          [color=blue]
          > you need to see if the source exists and create it if it doesn't...then
          > write to it:
          >
          > public shared sub LogEvent(byval Source as string, byval Message as string,
          > byval Type as eventlogentryty pe)
          > dim eventLog as new system.diagnost ics.eventlog
          > try
          > if not eventLog.Source Exists(Source) then
          > eventLog.Create EventSource(Sou rce, "Log Name Here")
          > eventLog.Log = "Log Name Here"
          > eventLog.WriteE ntry(Source, Message, Type)
          > catch ex as Exception
          > throw new ApplicationExce ption(ex.messag e, ex.innerexcepti on)
          > end try
          > end sub
          >
          > hth,
          >
          > steve
          >
          >
          > "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
          > news:CDF28C12-4735-41B9-A3D5-0A65B2BF4F38@mi crosoft.com...
          > | When I perform: EventLog.WriteE ntry(strSource, strEntry,
          > | EventLogEntryTy pe.Error, intEventID)
          > |
          > | The event viewer reports
          > |
          > | The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le )
          > cannot
          > | be found. The local computer may not have the necessary registry
          > information
          > | or message DLL files to display messages from a remote computer.
          > |
          > | I think I need to create a dll that returns error messages for event ID's.
          > | Can this dll be written in VB.NET?
          > | Any pointers to documentation that tells me how to go about creating this
          > dll?
          > |
          > | Or am I missing something and have got it totally wrong?
          > |
          > | Thanks in advance.
          > | Chris.
          >
          >
          >[/color]

          Comment

          • Jay B. Harlow [MVP - Outlook]

            #6
            Re: Create dll for EventViewer

            Chris,
            Do you delete the event source? You shouldn't!

            When you use CreateEventSour ce, entries are made in the registry that
            associations the event source with
            C:\WINDOWS\Micr osoft.NET\Frame work\v1.1.4322\ EventLogMessage s.dll (for
            VS.NET 2003 .NET 1.1) This dll handles all event log messages. It has a
            generic message that is able to display the message that your app sends.

            If you delete the event source these entries are removed, and you see you
            error.

            I'll see if I can find a link that explains the above...

            Hope this helps
            Jay

            "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
            news:50412DD1-09FD-4DD5-AC34-1BBCABDB3103@mi crosoft.com...[color=blue]
            >I know about checking if the source exists. It does and that's how I
            >actually
            > manage to get enties in the event log. What I want to do is stop the "The
            > description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le ) cannot be
            > found" message for my entries in the event viewer.
            >
            > "steve" wrote:
            >[color=green]
            >> you need to see if the source exists and create it if it doesn't...then
            >> write to it:
            >>
            >> public shared sub LogEvent(byval Source as string, byval Message as
            >> string,
            >> byval Type as eventlogentryty pe)
            >> dim eventLog as new system.diagnost ics.eventlog
            >> try
            >> if not eventLog.Source Exists(Source) then
            >> eventLog.Create EventSource(Sou rce, "Log Name Here")
            >> eventLog.Log = "Log Name Here"
            >> eventLog.WriteE ntry(Source, Message, Type)
            >> catch ex as Exception
            >> throw new ApplicationExce ption(ex.messag e, ex.innerexcepti on)
            >> end try
            >> end sub
            >>
            >> hth,
            >>
            >> steve
            >>
            >>
            >> "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
            >> news:CDF28C12-4735-41B9-A3D5-0A65B2BF4F38@mi crosoft.com...
            >> | When I perform: EventLog.WriteE ntry(strSource, strEntry,
            >> | EventLogEntryTy pe.Error, intEventID)
            >> |
            >> | The event viewer reports
            >> |
            >> | The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le )
            >> cannot
            >> | be found. The local computer may not have the necessary registry
            >> information
            >> | or message DLL files to display messages from a remote computer.
            >> |
            >> | I think I need to create a dll that returns error messages for event
            >> ID's.
            >> | Can this dll be written in VB.NET?
            >> | Any pointers to documentation that tells me how to go about creating
            >> this
            >> dll?
            >> |
            >> | Or am I missing something and have got it totally wrong?
            >> |
            >> | Thanks in advance.
            >> | Chris.
            >>
            >>
            >>[/color][/color]


            Comment

            • Jay B. Harlow [MVP - Outlook]

              #7
              Re: Create dll for EventViewer

              Chris,
              Do you delete the event source? You shouldn't!

              When you use CreateEventSour ce, entries are made in the registry that
              associations the event source with
              C:\WINDOWS\Micr osoft.NET\Frame work\v1.1.4322\ EventLogMessage s.dll (for
              VS.NET 2003 .NET 1.1) This dll handles all event log messages. It has a
              generic message that is able to display the message that your app sends.

              If you delete the event source these entries are removed, and you see you
              error.

              I'll see if I can find a link that explains the above...

              Hope this helps
              Jay

              "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
              news:50412DD1-09FD-4DD5-AC34-1BBCABDB3103@mi crosoft.com...[color=blue]
              >I know about checking if the source exists. It does and that's how I
              >actually
              > manage to get enties in the event log. What I want to do is stop the "The
              > description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le ) cannot be
              > found" message for my entries in the event viewer.
              >
              > "steve" wrote:
              >[color=green]
              >> you need to see if the source exists and create it if it doesn't...then
              >> write to it:
              >>
              >> public shared sub LogEvent(byval Source as string, byval Message as
              >> string,
              >> byval Type as eventlogentryty pe)
              >> dim eventLog as new system.diagnost ics.eventlog
              >> try
              >> if not eventLog.Source Exists(Source) then
              >> eventLog.Create EventSource(Sou rce, "Log Name Here")
              >> eventLog.Log = "Log Name Here"
              >> eventLog.WriteE ntry(Source, Message, Type)
              >> catch ex as Exception
              >> throw new ApplicationExce ption(ex.messag e, ex.innerexcepti on)
              >> end try
              >> end sub
              >>
              >> hth,
              >>
              >> steve
              >>
              >>
              >> "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
              >> news:CDF28C12-4735-41B9-A3D5-0A65B2BF4F38@mi crosoft.com...
              >> | When I perform: EventLog.WriteE ntry(strSource, strEntry,
              >> | EventLogEntryTy pe.Error, intEventID)
              >> |
              >> | The event viewer reports
              >> |
              >> | The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le )
              >> cannot
              >> | be found. The local computer may not have the necessary registry
              >> information
              >> | or message DLL files to display messages from a remote computer.
              >> |
              >> | I think I need to create a dll that returns error messages for event
              >> ID's.
              >> | Can this dll be written in VB.NET?
              >> | Any pointers to documentation that tells me how to go about creating
              >> this
              >> dll?
              >> |
              >> | Or am I missing something and have got it totally wrong?
              >> |
              >> | Thanks in advance.
              >> | Chris.
              >>
              >>
              >>[/color][/color]


              Comment

              • Jay B. Harlow [MVP - Outlook]

                #8
                Re: Create dll for EventViewer

                Chris,
                Here is a link that explains the EventLogMessage s.dll:
                Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


                Hope this helps
                Jay

                "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                news:50412DD1-09FD-4DD5-AC34-1BBCABDB3103@mi crosoft.com...[color=blue]
                >I know about checking if the source exists. It does and that's how I
                >actually
                > manage to get enties in the event log. What I want to do is stop the "The
                > description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le ) cannot be
                > found" message for my entries in the event viewer.
                >
                > "steve" wrote:
                >[color=green]
                >> you need to see if the source exists and create it if it doesn't...then
                >> write to it:
                >>
                >> public shared sub LogEvent(byval Source as string, byval Message as
                >> string,
                >> byval Type as eventlogentryty pe)
                >> dim eventLog as new system.diagnost ics.eventlog
                >> try
                >> if not eventLog.Source Exists(Source) then
                >> eventLog.Create EventSource(Sou rce, "Log Name Here")
                >> eventLog.Log = "Log Name Here"
                >> eventLog.WriteE ntry(Source, Message, Type)
                >> catch ex as Exception
                >> throw new ApplicationExce ption(ex.messag e, ex.innerexcepti on)
                >> end try
                >> end sub
                >>
                >> hth,
                >>
                >> steve
                >>
                >>
                >> "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                >> news:CDF28C12-4735-41B9-A3D5-0A65B2BF4F38@mi crosoft.com...
                >> | When I perform: EventLog.WriteE ntry(strSource, strEntry,
                >> | EventLogEntryTy pe.Error, intEventID)
                >> |
                >> | The event viewer reports
                >> |
                >> | The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le )
                >> cannot
                >> | be found. The local computer may not have the necessary registry
                >> information
                >> | or message DLL files to display messages from a remote computer.
                >> |
                >> | I think I need to create a dll that returns error messages for event
                >> ID's.
                >> | Can this dll be written in VB.NET?
                >> | Any pointers to documentation that tells me how to go about creating
                >> this
                >> dll?
                >> |
                >> | Or am I missing something and have got it totally wrong?
                >> |
                >> | Thanks in advance.
                >> | Chris.
                >>
                >>
                >>[/color][/color]


                Comment

                • Jay B. Harlow [MVP - Outlook]

                  #9
                  Re: Create dll for EventViewer

                  Chris,
                  Here is a link that explains the EventLogMessage s.dll:
                  Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


                  Hope this helps
                  Jay

                  "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                  news:50412DD1-09FD-4DD5-AC34-1BBCABDB3103@mi crosoft.com...[color=blue]
                  >I know about checking if the source exists. It does and that's how I
                  >actually
                  > manage to get enties in the event log. What I want to do is stop the "The
                  > description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le ) cannot be
                  > found" message for my entries in the event viewer.
                  >
                  > "steve" wrote:
                  >[color=green]
                  >> you need to see if the source exists and create it if it doesn't...then
                  >> write to it:
                  >>
                  >> public shared sub LogEvent(byval Source as string, byval Message as
                  >> string,
                  >> byval Type as eventlogentryty pe)
                  >> dim eventLog as new system.diagnost ics.eventlog
                  >> try
                  >> if not eventLog.Source Exists(Source) then
                  >> eventLog.Create EventSource(Sou rce, "Log Name Here")
                  >> eventLog.Log = "Log Name Here"
                  >> eventLog.WriteE ntry(Source, Message, Type)
                  >> catch ex as Exception
                  >> throw new ApplicationExce ption(ex.messag e, ex.innerexcepti on)
                  >> end try
                  >> end sub
                  >>
                  >> hth,
                  >>
                  >> steve
                  >>
                  >>
                  >> "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                  >> news:CDF28C12-4735-41B9-A3D5-0A65B2BF4F38@mi crosoft.com...
                  >> | When I perform: EventLog.WriteE ntry(strSource, strEntry,
                  >> | EventLogEntryTy pe.Error, intEventID)
                  >> |
                  >> | The event viewer reports
                  >> |
                  >> | The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le )
                  >> cannot
                  >> | be found. The local computer may not have the necessary registry
                  >> information
                  >> | or message DLL files to display messages from a remote computer.
                  >> |
                  >> | I think I need to create a dll that returns error messages for event
                  >> ID's.
                  >> | Can this dll be written in VB.NET?
                  >> | Any pointers to documentation that tells me how to go about creating
                  >> this
                  >> dll?
                  >> |
                  >> | Or am I missing something and have got it totally wrong?
                  >> |
                  >> | Thanks in advance.
                  >> | Chris.
                  >>
                  >>
                  >>[/color][/color]


                  Comment

                  • Chris Podmore

                    #10
                    Re: Create dll for EventViewer

                    Jay,

                    Thanks for all you help. The link was very useful.
                    I hadn't actually used CreateEventSour ce as it's a web service that's
                    creating events and it doesn't have permission to create the source so this
                    was a manual task. For now all I done is update our documentation to say that
                    the EventMessageFil e string value needs creating and populating. This has
                    stopped the annoying "The description for Event ID (???) in Source (xxx)
                    cannot be found".

                    Thanks.
                    Chris.

                    "Jay B. Harlow [MVP - Outlook]" wrote:
                    [color=blue]
                    > Chris,
                    > Here is a link that explains the EventLogMessage s.dll:
                    > http://msdn.microsoft.com/msdnmag/is...T/default.aspx
                    >
                    > Hope this helps
                    > Jay
                    >
                    > "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                    > news:50412DD1-09FD-4DD5-AC34-1BBCABDB3103@mi crosoft.com...[color=green]
                    > >I know about checking if the source exists. It does and that's how I
                    > >actually
                    > > manage to get enties in the event log. What I want to do is stop the "The
                    > > description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le ) cannot be
                    > > found" message for my entries in the event viewer.
                    > >
                    > > "steve" wrote:
                    > >[color=darkred]
                    > >> you need to see if the source exists and create it if it doesn't...then
                    > >> write to it:
                    > >>
                    > >> public shared sub LogEvent(byval Source as string, byval Message as
                    > >> string,
                    > >> byval Type as eventlogentryty pe)
                    > >> dim eventLog as new system.diagnost ics.eventlog
                    > >> try
                    > >> if not eventLog.Source Exists(Source) then
                    > >> eventLog.Create EventSource(Sou rce, "Log Name Here")
                    > >> eventLog.Log = "Log Name Here"
                    > >> eventLog.WriteE ntry(Source, Message, Type)
                    > >> catch ex as Exception
                    > >> throw new ApplicationExce ption(ex.messag e, ex.innerexcepti on)
                    > >> end try
                    > >> end sub
                    > >>
                    > >> hth,
                    > >>
                    > >> steve
                    > >>
                    > >>
                    > >> "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                    > >> news:CDF28C12-4735-41B9-A3D5-0A65B2BF4F38@mi crosoft.com...
                    > >> | When I perform: EventLog.WriteE ntry(strSource, strEntry,
                    > >> | EventLogEntryTy pe.Error, intEventID)
                    > >> |
                    > >> | The event viewer reports
                    > >> |
                    > >> | The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le )
                    > >> cannot
                    > >> | be found. The local computer may not have the necessary registry
                    > >> information
                    > >> | or message DLL files to display messages from a remote computer.
                    > >> |
                    > >> | I think I need to create a dll that returns error messages for event
                    > >> ID's.
                    > >> | Can this dll be written in VB.NET?
                    > >> | Any pointers to documentation that tells me how to go about creating
                    > >> this
                    > >> dll?
                    > >> |
                    > >> | Or am I missing something and have got it totally wrong?
                    > >> |
                    > >> | Thanks in advance.
                    > >> | Chris.
                    > >>
                    > >>
                    > >>[/color][/color]
                    >
                    >
                    >[/color]

                    Comment

                    • Chris Podmore

                      #11
                      Re: Create dll for EventViewer

                      Jay,

                      Thanks for all you help. The link was very useful.
                      I hadn't actually used CreateEventSour ce as it's a web service that's
                      creating events and it doesn't have permission to create the source so this
                      was a manual task. For now all I done is update our documentation to say that
                      the EventMessageFil e string value needs creating and populating. This has
                      stopped the annoying "The description for Event ID (???) in Source (xxx)
                      cannot be found".

                      Thanks.
                      Chris.

                      "Jay B. Harlow [MVP - Outlook]" wrote:
                      [color=blue]
                      > Chris,
                      > Here is a link that explains the EventLogMessage s.dll:
                      > http://msdn.microsoft.com/msdnmag/is...T/default.aspx
                      >
                      > Hope this helps
                      > Jay
                      >
                      > "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                      > news:50412DD1-09FD-4DD5-AC34-1BBCABDB3103@mi crosoft.com...[color=green]
                      > >I know about checking if the source exists. It does and that's how I
                      > >actually
                      > > manage to get enties in the event log. What I want to do is stop the "The
                      > > description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le ) cannot be
                      > > found" message for my entries in the event viewer.
                      > >
                      > > "steve" wrote:
                      > >[color=darkred]
                      > >> you need to see if the source exists and create it if it doesn't...then
                      > >> write to it:
                      > >>
                      > >> public shared sub LogEvent(byval Source as string, byval Message as
                      > >> string,
                      > >> byval Type as eventlogentryty pe)
                      > >> dim eventLog as new system.diagnost ics.eventlog
                      > >> try
                      > >> if not eventLog.Source Exists(Source) then
                      > >> eventLog.Create EventSource(Sou rce, "Log Name Here")
                      > >> eventLog.Log = "Log Name Here"
                      > >> eventLog.WriteE ntry(Source, Message, Type)
                      > >> catch ex as Exception
                      > >> throw new ApplicationExce ption(ex.messag e, ex.innerexcepti on)
                      > >> end try
                      > >> end sub
                      > >>
                      > >> hth,
                      > >>
                      > >> steve
                      > >>
                      > >>
                      > >> "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                      > >> news:CDF28C12-4735-41B9-A3D5-0A65B2BF4F38@mi crosoft.com...
                      > >> | When I perform: EventLog.WriteE ntry(strSource, strEntry,
                      > >> | EventLogEntryTy pe.Error, intEventID)
                      > >> |
                      > >> | The event viewer reports
                      > >> |
                      > >> | The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le )
                      > >> cannot
                      > >> | be found. The local computer may not have the necessary registry
                      > >> information
                      > >> | or message DLL files to display messages from a remote computer.
                      > >> |
                      > >> | I think I need to create a dll that returns error messages for event
                      > >> ID's.
                      > >> | Can this dll be written in VB.NET?
                      > >> | Any pointers to documentation that tells me how to go about creating
                      > >> this
                      > >> dll?
                      > >> |
                      > >> | Or am I missing something and have got it totally wrong?
                      > >> |
                      > >> | Thanks in advance.
                      > >> | Chris.
                      > >>
                      > >>
                      > >>[/color][/color]
                      >
                      >
                      >[/color]

                      Comment

                      • Jay B. Harlow [MVP - Outlook]

                        #12
                        Re: Create dll for EventViewer

                        Chris,
                        I hope you didn't say to update the registry directly!

                        As the EventLogInstall er class is designed to update the registry, in all
                        the correct places, with all the correct values...

                        What I normally do is create an ProjectInstalle r class in my project, that
                        includes an EventLogInstall er object. When I deploy the web service I use
                        installutil.exe (on the server) to allow any installer classes in the
                        assembly to be ran. This way there is not a lot of manual fiddling if the
                        project ever needs to be deployed on a backup server.

                        Alternatively with the ProjectInstalle r you can create a setup project to
                        deploy the web service...

                        Hope this helps
                        Jay

                        "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                        news:F22FFDD1-B6B9-43E9-88E6-C2FC79CA258F@mi crosoft.com...[color=blue]
                        > Jay,
                        >
                        > Thanks for all you help. The link was very useful.
                        > I hadn't actually used CreateEventSour ce as it's a web service that's
                        > creating events and it doesn't have permission to create the source so
                        > this
                        > was a manual task. For now all I done is update our documentation to say
                        > that
                        > the EventMessageFil e string value needs creating and populating. This has
                        > stopped the annoying "The description for Event ID (???) in Source (xxx)
                        > cannot be found".
                        >
                        > Thanks.
                        > Chris.
                        >
                        > "Jay B. Harlow [MVP - Outlook]" wrote:
                        >[color=green]
                        >> Chris,
                        >> Here is a link that explains the EventLogMessage s.dll:
                        >> http://msdn.microsoft.com/msdnmag/is...T/default.aspx
                        >>
                        >> Hope this helps
                        >> Jay
                        >>
                        >> "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                        >> news:50412DD1-09FD-4DD5-AC34-1BBCABDB3103@mi crosoft.com...[color=darkred]
                        >> >I know about checking if the source exists. It does and that's how I
                        >> >actually
                        >> > manage to get enties in the event log. What I want to do is stop the
                        >> > "The
                        >> > description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le ) cannot
                        >> > be
                        >> > found" message for my entries in the event viewer.
                        >> >
                        >> > "steve" wrote:
                        >> >
                        >> >> you need to see if the source exists and create it if it
                        >> >> doesn't...then
                        >> >> write to it:
                        >> >>
                        >> >> public shared sub LogEvent(byval Source as string, byval Message as
                        >> >> string,
                        >> >> byval Type as eventlogentryty pe)
                        >> >> dim eventLog as new system.diagnost ics.eventlog
                        >> >> try
                        >> >> if not eventLog.Source Exists(Source) then
                        >> >> eventLog.Create EventSource(Sou rce, "Log Name Here")
                        >> >> eventLog.Log = "Log Name Here"
                        >> >> eventLog.WriteE ntry(Source, Message, Type)
                        >> >> catch ex as Exception
                        >> >> throw new ApplicationExce ption(ex.messag e, ex.innerexcepti on)
                        >> >> end try
                        >> >> end sub
                        >> >>
                        >> >> hth,
                        >> >>
                        >> >> steve
                        >> >>
                        >> >>
                        >> >> "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in
                        >> >> message
                        >> >> news:CDF28C12-4735-41B9-A3D5-0A65B2BF4F38@mi crosoft.com...
                        >> >> | When I perform: EventLog.WriteE ntry(strSource, strEntry,
                        >> >> | EventLogEntryTy pe.Error, intEventID)
                        >> >> |
                        >> >> | The event viewer reports
                        >> >> |
                        >> >> | The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le )
                        >> >> cannot
                        >> >> | be found. The local computer may not have the necessary registry
                        >> >> information
                        >> >> | or message DLL files to display messages from a remote computer.
                        >> >> |
                        >> >> | I think I need to create a dll that returns error messages for event
                        >> >> ID's.
                        >> >> | Can this dll be written in VB.NET?
                        >> >> | Any pointers to documentation that tells me how to go about creating
                        >> >> this
                        >> >> dll?
                        >> >> |
                        >> >> | Or am I missing something and have got it totally wrong?
                        >> >> |
                        >> >> | Thanks in advance.
                        >> >> | Chris.
                        >> >>
                        >> >>
                        >> >>[/color]
                        >>
                        >>
                        >>[/color][/color]


                        Comment

                        • Jay B. Harlow [MVP - Outlook]

                          #13
                          Re: Create dll for EventViewer

                          Chris,
                          I hope you didn't say to update the registry directly!

                          As the EventLogInstall er class is designed to update the registry, in all
                          the correct places, with all the correct values...

                          What I normally do is create an ProjectInstalle r class in my project, that
                          includes an EventLogInstall er object. When I deploy the web service I use
                          installutil.exe (on the server) to allow any installer classes in the
                          assembly to be ran. This way there is not a lot of manual fiddling if the
                          project ever needs to be deployed on a backup server.

                          Alternatively with the ProjectInstalle r you can create a setup project to
                          deploy the web service...

                          Hope this helps
                          Jay

                          "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                          news:F22FFDD1-B6B9-43E9-88E6-C2FC79CA258F@mi crosoft.com...[color=blue]
                          > Jay,
                          >
                          > Thanks for all you help. The link was very useful.
                          > I hadn't actually used CreateEventSour ce as it's a web service that's
                          > creating events and it doesn't have permission to create the source so
                          > this
                          > was a manual task. For now all I done is update our documentation to say
                          > that
                          > the EventMessageFil e string value needs creating and populating. This has
                          > stopped the annoying "The description for Event ID (???) in Source (xxx)
                          > cannot be found".
                          >
                          > Thanks.
                          > Chris.
                          >
                          > "Jay B. Harlow [MVP - Outlook]" wrote:
                          >[color=green]
                          >> Chris,
                          >> Here is a link that explains the EventLogMessage s.dll:
                          >> http://msdn.microsoft.com/msdnmag/is...T/default.aspx
                          >>
                          >> Hope this helps
                          >> Jay
                          >>
                          >> "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                          >> news:50412DD1-09FD-4DD5-AC34-1BBCABDB3103@mi crosoft.com...[color=darkred]
                          >> >I know about checking if the source exists. It does and that's how I
                          >> >actually
                          >> > manage to get enties in the event log. What I want to do is stop the
                          >> > "The
                          >> > description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le ) cannot
                          >> > be
                          >> > found" message for my entries in the event viewer.
                          >> >
                          >> > "steve" wrote:
                          >> >
                          >> >> you need to see if the source exists and create it if it
                          >> >> doesn't...then
                          >> >> write to it:
                          >> >>
                          >> >> public shared sub LogEvent(byval Source as string, byval Message as
                          >> >> string,
                          >> >> byval Type as eventlogentryty pe)
                          >> >> dim eventLog as new system.diagnost ics.eventlog
                          >> >> try
                          >> >> if not eventLog.Source Exists(Source) then
                          >> >> eventLog.Create EventSource(Sou rce, "Log Name Here")
                          >> >> eventLog.Log = "Log Name Here"
                          >> >> eventLog.WriteE ntry(Source, Message, Type)
                          >> >> catch ex as Exception
                          >> >> throw new ApplicationExce ption(ex.messag e, ex.innerexcepti on)
                          >> >> end try
                          >> >> end sub
                          >> >>
                          >> >> hth,
                          >> >>
                          >> >> steve
                          >> >>
                          >> >>
                          >> >> "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in
                          >> >> message
                          >> >> news:CDF28C12-4735-41B9-A3D5-0A65B2BF4F38@mi crosoft.com...
                          >> >> | When I perform: EventLog.WriteE ntry(strSource, strEntry,
                          >> >> | EventLogEntryTy pe.Error, intEventID)
                          >> >> |
                          >> >> | The event viewer reports
                          >> >> |
                          >> >> | The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le )
                          >> >> cannot
                          >> >> | be found. The local computer may not have the necessary registry
                          >> >> information
                          >> >> | or message DLL files to display messages from a remote computer.
                          >> >> |
                          >> >> | I think I need to create a dll that returns error messages for event
                          >> >> ID's.
                          >> >> | Can this dll be written in VB.NET?
                          >> >> | Any pointers to documentation that tells me how to go about creating
                          >> >> this
                          >> >> dll?
                          >> >> |
                          >> >> | Or am I missing something and have got it totally wrong?
                          >> >> |
                          >> >> | Thanks in advance.
                          >> >> | Chris.
                          >> >>
                          >> >>
                          >> >>[/color]
                          >>
                          >>
                          >>[/color][/color]


                          Comment

                          • Chris Podmore

                            #14
                            Re: Create dll for EventViewer

                            It was done directly. The web service is currently installed on one of our
                            test IIS servers. I haven't got round to creating the deployment bits due to
                            pressure from above for our support team to be able to access the web service
                            so they can test it's functionality is correct.

                            Chris.

                            "Jay B. Harlow [MVP - Outlook]" wrote:
                            [color=blue]
                            > Chris,
                            > I hope you didn't say to update the registry directly!
                            >
                            > As the EventLogInstall er class is designed to update the registry, in all
                            > the correct places, with all the correct values...
                            >
                            > What I normally do is create an ProjectInstalle r class in my project, that
                            > includes an EventLogInstall er object. When I deploy the web service I use
                            > installutil.exe (on the server) to allow any installer classes in the
                            > assembly to be ran. This way there is not a lot of manual fiddling if the
                            > project ever needs to be deployed on a backup server.
                            >
                            > Alternatively with the ProjectInstalle r you can create a setup project to
                            > deploy the web service...
                            >
                            > Hope this helps
                            > Jay
                            >
                            > "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                            > news:F22FFDD1-B6B9-43E9-88E6-C2FC79CA258F@mi crosoft.com...[color=green]
                            > > Jay,
                            > >
                            > > Thanks for all you help. The link was very useful.
                            > > I hadn't actually used CreateEventSour ce as it's a web service that's
                            > > creating events and it doesn't have permission to create the source so
                            > > this
                            > > was a manual task. For now all I done is update our documentation to say
                            > > that
                            > > the EventMessageFil e string value needs creating and populating. This has
                            > > stopped the annoying "The description for Event ID (???) in Source (xxx)
                            > > cannot be found".
                            > >
                            > > Thanks.
                            > > Chris.
                            > >
                            > > "Jay B. Harlow [MVP - Outlook]" wrote:
                            > >[color=darkred]
                            > >> Chris,
                            > >> Here is a link that explains the EventLogMessage s.dll:
                            > >> http://msdn.microsoft.com/msdnmag/is...T/default.aspx
                            > >>
                            > >> Hope this helps
                            > >> Jay
                            > >>
                            > >> "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                            > >> news:50412DD1-09FD-4DD5-AC34-1BBCABDB3103@mi crosoft.com...
                            > >> >I know about checking if the source exists. It does and that's how I
                            > >> >actually
                            > >> > manage to get enties in the event log. What I want to do is stop the
                            > >> > "The
                            > >> > description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le ) cannot
                            > >> > be
                            > >> > found" message for my entries in the event viewer.
                            > >> >
                            > >> > "steve" wrote:
                            > >> >
                            > >> >> you need to see if the source exists and create it if it
                            > >> >> doesn't...then
                            > >> >> write to it:
                            > >> >>
                            > >> >> public shared sub LogEvent(byval Source as string, byval Message as
                            > >> >> string,
                            > >> >> byval Type as eventlogentryty pe)
                            > >> >> dim eventLog as new system.diagnost ics.eventlog
                            > >> >> try
                            > >> >> if not eventLog.Source Exists(Source) then
                            > >> >> eventLog.Create EventSource(Sou rce, "Log Name Here")
                            > >> >> eventLog.Log = "Log Name Here"
                            > >> >> eventLog.WriteE ntry(Source, Message, Type)
                            > >> >> catch ex as Exception
                            > >> >> throw new ApplicationExce ption(ex.messag e, ex.innerexcepti on)
                            > >> >> end try
                            > >> >> end sub
                            > >> >>
                            > >> >> hth,
                            > >> >>
                            > >> >> steve
                            > >> >>
                            > >> >>
                            > >> >> "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in
                            > >> >> message
                            > >> >> news:CDF28C12-4735-41B9-A3D5-0A65B2BF4F38@mi crosoft.com...
                            > >> >> | When I perform: EventLog.WriteE ntry(strSource, strEntry,
                            > >> >> | EventLogEntryTy pe.Error, intEventID)
                            > >> >> |
                            > >> >> | The event viewer reports
                            > >> >> |
                            > >> >> | The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le )
                            > >> >> cannot
                            > >> >> | be found. The local computer may not have the necessary registry
                            > >> >> information
                            > >> >> | or message DLL files to display messages from a remote computer.
                            > >> >> |
                            > >> >> | I think I need to create a dll that returns error messages for event
                            > >> >> ID's.
                            > >> >> | Can this dll be written in VB.NET?
                            > >> >> | Any pointers to documentation that tells me how to go about creating
                            > >> >> this
                            > >> >> dll?
                            > >> >> |
                            > >> >> | Or am I missing something and have got it totally wrong?
                            > >> >> |
                            > >> >> | Thanks in advance.
                            > >> >> | Chris.
                            > >> >>
                            > >> >>
                            > >> >>
                            > >>
                            > >>
                            > >>[/color][/color]
                            >
                            >
                            >[/color]

                            Comment

                            • Chris Podmore

                              #15
                              Re: Create dll for EventViewer

                              It was done directly. The web service is currently installed on one of our
                              test IIS servers. I haven't got round to creating the deployment bits due to
                              pressure from above for our support team to be able to access the web service
                              so they can test it's functionality is correct.

                              Chris.

                              "Jay B. Harlow [MVP - Outlook]" wrote:
                              [color=blue]
                              > Chris,
                              > I hope you didn't say to update the registry directly!
                              >
                              > As the EventLogInstall er class is designed to update the registry, in all
                              > the correct places, with all the correct values...
                              >
                              > What I normally do is create an ProjectInstalle r class in my project, that
                              > includes an EventLogInstall er object. When I deploy the web service I use
                              > installutil.exe (on the server) to allow any installer classes in the
                              > assembly to be ran. This way there is not a lot of manual fiddling if the
                              > project ever needs to be deployed on a backup server.
                              >
                              > Alternatively with the ProjectInstalle r you can create a setup project to
                              > deploy the web service...
                              >
                              > Hope this helps
                              > Jay
                              >
                              > "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                              > news:F22FFDD1-B6B9-43E9-88E6-C2FC79CA258F@mi crosoft.com...[color=green]
                              > > Jay,
                              > >
                              > > Thanks for all you help. The link was very useful.
                              > > I hadn't actually used CreateEventSour ce as it's a web service that's
                              > > creating events and it doesn't have permission to create the source so
                              > > this
                              > > was a manual task. For now all I done is update our documentation to say
                              > > that
                              > > the EventMessageFil e string value needs creating and populating. This has
                              > > stopped the annoying "The description for Event ID (???) in Source (xxx)
                              > > cannot be found".
                              > >
                              > > Thanks.
                              > > Chris.
                              > >
                              > > "Jay B. Harlow [MVP - Outlook]" wrote:
                              > >[color=darkred]
                              > >> Chris,
                              > >> Here is a link that explains the EventLogMessage s.dll:
                              > >> http://msdn.microsoft.com/msdnmag/is...T/default.aspx
                              > >>
                              > >> Hope this helps
                              > >> Jay
                              > >>
                              > >> "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in message
                              > >> news:50412DD1-09FD-4DD5-AC34-1BBCABDB3103@mi crosoft.com...
                              > >> >I know about checking if the source exists. It does and that's how I
                              > >> >actually
                              > >> > manage to get enties in the event log. What I want to do is stop the
                              > >> > "The
                              > >> > description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le ) cannot
                              > >> > be
                              > >> > found" message for my entries in the event viewer.
                              > >> >
                              > >> > "steve" wrote:
                              > >> >
                              > >> >> you need to see if the source exists and create it if it
                              > >> >> doesn't...then
                              > >> >> write to it:
                              > >> >>
                              > >> >> public shared sub LogEvent(byval Source as string, byval Message as
                              > >> >> string,
                              > >> >> byval Type as eventlogentryty pe)
                              > >> >> dim eventLog as new system.diagnost ics.eventlog
                              > >> >> try
                              > >> >> if not eventLog.Source Exists(Source) then
                              > >> >> eventLog.Create EventSource(Sou rce, "Log Name Here")
                              > >> >> eventLog.Log = "Log Name Here"
                              > >> >> eventLog.WriteE ntry(Source, Message, Type)
                              > >> >> catch ex as Exception
                              > >> >> throw new ApplicationExce ption(ex.messag e, ex.innerexcepti on)
                              > >> >> end try
                              > >> >> end sub
                              > >> >>
                              > >> >> hth,
                              > >> >>
                              > >> >> steve
                              > >> >>
                              > >> >>
                              > >> >> "Chris Podmore" <ChrisPodmore@d iscussions.micr osoft.com> wrote in
                              > >> >> message
                              > >> >> news:CDF28C12-4735-41B9-A3D5-0A65B2BF4F38@mi crosoft.com...
                              > >> >> | When I perform: EventLog.WriteE ntry(strSource, strEntry,
                              > >> >> | EventLogEntryTy pe.Error, intEventID)
                              > >> >> |
                              > >> >> | The event viewer reports
                              > >> >> |
                              > >> >> | The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobi le )
                              > >> >> cannot
                              > >> >> | be found. The local computer may not have the necessary registry
                              > >> >> information
                              > >> >> | or message DLL files to display messages from a remote computer.
                              > >> >> |
                              > >> >> | I think I need to create a dll that returns error messages for event
                              > >> >> ID's.
                              > >> >> | Can this dll be written in VB.NET?
                              > >> >> | Any pointers to documentation that tells me how to go about creating
                              > >> >> this
                              > >> >> dll?
                              > >> >> |
                              > >> >> | Or am I missing something and have got it totally wrong?
                              > >> >> |
                              > >> >> | Thanks in advance.
                              > >> >> | Chris.
                              > >> >>
                              > >> >>
                              > >> >>
                              > >>
                              > >>
                              > >>[/color][/color]
                              >
                              >
                              >[/color]

                              Comment

                              Working...