CA1057: String URI overloads call System.Uri overloads
|
TypeName |
StringUriOverloadsCallSystemUriOverloads |
|
CheckId |
CA1057 |
|
Category |
Microsoft.Design |
|
Breaking Change |
Non-breaking |
A type declares method overloads that differ only by the replacement of a string parameter with a System.Uri parameter, and the overload that takes the string parameter does not call the overload that takes the Uri parameter.
Because the overloads differ only by the string/Uri parameter, the string is assumed to represent a uniform resource identifier (URI). A string representation of a URI is prone to parsing and encoding errors, and can lead to security vulnerabilities. The Uri class provides these services in a safe and secure manner. To reap the benefits of the Uri class, the string overload should call the Uri overload using the string argument.