Facing run time exception when i am trying to write exception to Database from Windows application

Posted by Vinayakpk under C# on 7/4/2017 | Points: 10 | Views : 601 | Status : [Member] | Replies : 0
Hi,

The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyImpl, ClientExceptionPolicy]) failed: Object reference not set to an instance of an object. (Strategy type ConfiguredObjectStrategy, index 2)

I have been facing this exception when i am implementing exception handling in windows application, in which i need to achieve - Write the exception message to Daatabase

Please find below lines of code

catch (Exception ex)
{

string exeptionMessage = ex.Message;
ClientException cex = ex as ClientException;

string errorId = default(string);
ExceptionPolicy.HandleException(ex, "ClientExceptionPolicy");
errorId = ex.Data["HandlingInstanceID"].ToString();

}

Exception is thowing in this perticula line

ExceptionPolicy.HandleException(ex, "ClientExceptionPolicy");

I have added all corresponding Dll.




Responses

(No response found.)

Login to post response