I have a SomeNameController.cs file in App_Code. In this cs file, I have a piece of code in try-catch block. Inside catch block I am trying to log the exception, but when an exception is logged (ex:Object reference not set to an instance of an object.), I cannot find in which line number this occurred as we normally get in stack trace.
catch (Exception ex) {
string errorMsg = string.Format("[SomeNameController][Save]- Msg: {0}", ex.ToString());
LogHelper.Error(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, errorMsg, ex);
}
Note: I don't have pdb file for this as this file is in App_Code