我有一个会抛出通用异常的方法,我想对它进行文档记录,但是我不知道如何编写有效的xml文档。
/// <summary>
/// Throws any exception.
/// </summary>
/// <typeparam name="TException">Type of the exception to throw </typeparam>
/// <exception cref="TException"> Thrown when whatever.... </exception>
public static void Throw<TException>() where TException : Exception
{
throw (TException)Activator.CreateInstance(typeof(TException));
}
上述代码会导致以下错误:
XML注释具有引用类型参数的csref属性。