As other answers have mentioned; you cannot directly specify to catch every WebFaultException<T> without either knowing the specified type argument, or catching it’s base type instead.
However, if you were wanting to catch all WebFaultException occurrences and handle the response differently based on what the generic type is, then you could simply catch the base type and use reflection to determine the type of the generic argument using Type.GetGenericArguments(). Here is a simple catch clause to show how you may go about doing it:
// ...
catch (FaultException ex)
{
Type exceptionType = ex.GetType();
if (exceptionType.IsGenericType)
{
// Find the type of the generic parameter
Type genericType = ex.GetType().GetGenericArguments().FirstOrDefault();
if (genericType != null)
{
// TODO: Handle the generic type.
}
}
}
If you want a more indepth example, I have uploaded a test program to demonstrate this to PasteBin. Feel free to take a look!