I have a Custom class, InvalidCodeException in Project A
public class InvalidCodeException : Exception
{
public InvalidCodeException ()
{
}
public InvalidCodeException (string message)
: base(message)
{
}
public InvalidCodeException (string message, Exception innerException)
: base(message, innerException)
{
}
}
a WCF service in Project B. And a client in Project C. Project A is referenced in Project B and C.
I am throwing InvalidCodeException from Project B and catching in Project C. Problem is that when debuggin, the exception is not catching in
catch (InvalidCodeException ex)
{
Trace.WriteLine("CustomException");
throw;
}
but in
catch (Exception ex)
{ throw; }
See Question&Answers more detail:os