Hi,
I had hosted wcf service in IIS server. I am using that service from WPF application.
Suddenly exception error is coming from hosted service method.I have unable to take exception line number from hosted service method.
Is it possible to get that exception line number?
What I have tried:
private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
dynamic stackTrace_val = new StackTrace((e.Exception));
for (int i = 0; i <= stackTrace_val.FrameCount - 1; i++)
{
if ((method.DeclaringType.Assembly == Assembly.GetExecutingAssembly()))
{
dynamic stackFrame_val = stackTrace_val.GetFrame(i);
dynamic method = stackFrame_val.GetMethod();
Logger.Error("Exception in page :: " + (method.DeclaringType).FullName + ", Exception in method :: " + method.Name ", Exception in Line Number :: " + (new StackTrace(e.Exception, true)).frames[i].iLineNumber);
}
}
}