Pages

Sunday, September 28, 2008

Error OnStart an Windows Service

If you recently get the following error when starting a service.

EventType clr20r3, P1 [application name].exe, P2 1.0.0.29354, P3 487d2235, P4 [application name], P5 1.0.0.29354, P6 487d2235, P7 38, P8 1, P9 system.typeinitialization, P10 NIL.

I got the solution. We should put a try/catch on static method, especially on [any]appsetting.cs if you call any its properties on Start method. On our own app.config loading method, we do have the way to through an exception (ex: when empty or invalid), but our exception does not sink to the outer exception wrapper then Windows thinks that is an unhandled exception and records the following error in Event Viewer which causes a headache when trying to figure out what the real error is.

SQL Server 2005: "A severe error occurred on the current command"

If you recently work on SQL Server Management Studio and getting this error:

Msg 0, Level 11, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded.

Go here to request the link to download hotfix. 
For more information, 
go here.

System.Web.HttpException: Maximum request length exceeded.

If you recently got following error when calling any method to upload loan package to server:

System.Web.HttpException: Maximum request length exceeded.

This is because the default maximum HTTP request if not set is 4MB (4096). If you want to upload more than that, you must modify element
in section

<snip>
   <system.web>
      ...
      <httpruntime maxrequestlength="[maximum length (ex: 15360 = 15(MB) x 1024]">
         ...
      </httpruntime>
   </system.web>
</snip>


On machine.config if you want all your applications on IIS have the same configuration.
Or on
web.config if you want only the modified application is affected by the new policy.