应该从Propery Set抛出什么异常?

Sei*_*bar 1 .net language-agnostic exception

在.NET中,如果有人将非法值传递set { }给属性的某个部分,应该抛出什么类型的异常?

例:

public string Provider
{
    get { return _provider; }
    set
    {
        if (String.IsNullOrEmpty(value)) throw new Exception("Provider cannot be null or empty."); //what type of exception should be thrown here instead?
        _provider = value;
    }
}
Run Code Online (Sandbox Code Playgroud)

注意:

我问这个问题,因为它适用于.NET,但它也适用于许多其他语言.因此,如果您有一个适用于.NET框架之外的其他问题的好答案,请发布!

cta*_*cke 7

ArgumentException,ArgumentOutOfRangeException,ArgumentNullException或类似的.