Saturday, October 9, 2010

Enterprise Library and custom Exception Handler

If you are using the Microsoft Enterprise Library, trying to implement IExceptionHandler, and your custom exception handler is not firing, then this post is for you.

Check the following things:
1 - Make sure your IExceptionHandler class is prefixed by the attribute [ConfigurationElementType(typeof(CustomHandlerData))]

2 - Make sure your IException Handler class has not only a public constructor, but a public constructor that accepts a NameValueCollection argument. I.e.

public MyHandlerClass(NameValueCollection collection) {}

3 - Are you calling ExceptionPolicy.HandleException(exc, "YourExceptionPolicyName") ? If not, add that to where you catch exceptions globally, such as Global.asax's Application_Error in a web application.

4 - Check your web.config setup. The add node has a type="X, Y" property where X is the name of your class and Y is the assembly.

<exceptionHandling>
<exceptionPolicies>
<add name="My Exception Policy">
<exceptionTypes>
<add name="All Exceptions" type="System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
postHandlingAction="None">
<exceptionHandlers>
<add type="CustomExceptionHandler, MyAssemblyThatContainsHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
name="CustomExceptionHandler" />
</exceptionHandlers>
</add>
</exceptionTypes>
</add>
</exceptionPolicies>
</exceptionHandling>

Sunday, September 26, 2010

Final Fantasy XIV

I picked up the collector's edition of Final Fantasy XIV. I originally pre-ordered through Best Buy but they didn't have it on the day it was expected, so after a long day dealing with the customer service, cancelled and just bought it at the local GameStop.

The game was a bit buggy and really slow for me. Supposedly this is to be expected for the launch day of a new MMO. But I expected it to be a little more polished than it was. A lot of jerky motion plus quite a few crashes.

Since my video card wasn't top-notch, I went ahead and bought an upgrade (along with a new power supply) to run it. For reference to anyone with a similar machine, here's what I did:

I have a Gateway GM5632E machine and wanted to get a GTX 460 graphics card. The card recommends a power supply of 450W and this machine came with only a 400W (Delta DPS-400rb). I picked up a Corsair 650W and installed it along with the new graphics card. Everything worked perfect and I could tell a dramatic difference in FFXIV. However, after just 1 day the computer shut down. I noticed power wasn't getting to my case fan and after testing with the old power supply, verified the new power supply was toast! I returned that one and got a Corsair 750W and it has been working fine.