Hi there,

Recently I got the following error when starting a windows service that was calling a cross domain webservice:

EventType clr20r3, P1 kidyevwoifqwsnnsswwfxf5wpma0nhqc, P2 1.0.0.0, P3 492a76d8, P4 system.configuration, P5 2.0.0.0, P6 471ebf00, P7 1a6, P8 136, P9 ioibmurhynrxkw0zxkyrvfn0boyyufow, P10 NIL.


After doing some gooooooogling I got to the following website: http://social.msdn.microsoft.com/Forums/en-US/asmxandxml/thread/9ec62bfb-af83-4cbe-afae-129bda463506/ which let me to http://devproj20.blogspot.com/2007/03/eventtype-clr20r3-from-windows-service.html.

There was stated that 'The error is an example of an unhandled exception being thrown out of the application. You can make some sense of the error by implementing a handler for the UnhandledException event on the current AppDomain that your application is running in. This event will pass in the exception object that has been thrown, so you can log it to the Event Viewer in a more meaningful fashion.'

So I handled the UnhandledException in my code by writing the following code:

AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

/// <summary>
/// Handles the UnhandledException event of the CurrentDomain control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.UnhandledExceptionEventArgs"/> instance containing the event data.</param>
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Exception exception = e.ExceptionObject as Exception;
            if (exception != null)
            {
                System.Diagnostics.EventLog.WriteEntry("service", exception.InnerException.Message, EventLogEntryType.Error);
            }
        }


But still no readable entry in the EventLog Undecided

Than I got a mind-blowing revelation, which alerted me by trying under which account the windows service was running. We have the following System Accounts:

  • Local System account
  • Local Service account
  • Network Service account.
I then saw that my service was installed and running as a Local Service account, and according to Microsoft a service that runs as the Local Service account accesses network resources as a null session; that is, it uses anonymous credentials. The actual name of the account is NT AUTHORITY\LocalService, and it does not have a password that an administrator needs to manage.

And I guess that was my big problem, because of making cross-domain calls to the webservice.

After chaning the system account to local system, the windows started! Easy as a cake! Laughing

Hope this is usefull!, at least I learned something! Embarassed

gr,

Robbert

 

kick it on DotNetKicks.com
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList