我希望能够捕捉WebFaultException<string>到最具体的一个WebFaultException<T>(T是任何其他类型)作为更一般的情况来处理.这可能吗?
try
{
// throw exception
}
catch (WebFaultException<string> e)
{
// handle more specific type
}
catch (WebFaultException<T> e)
{
// handle more general type
}
catch (Exception e)
{
}
Run Code Online (Sandbox Code Playgroud)