XML System.Xml [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.Object XmlResolver is used to resolve external XML resources, such as entities, document type definitions (DTDs), or schemas. It is also used to process include and import elements found in Extensible StyleSheet Language (XSL) style sheets or XML Schema definition language (XSD) schemas. is a concrete implementation of XmlResolver and is the default resolver for all classes in the System.Xml namespace. You can also create your own resolver.

Security Considerations

Consider the following items when working with the class. objects can contain sensitive information such as user credentials. You should be careful when caching objects and should not pass the object to an untrusted component. If you are designing a class property that uses the class, the property should be defined as a write-only property. The property can be used to specify the to use, but it cannot be used to return an object. If your application accepts objects from untrusted code, you cannot assume that the URI passed into the method will be the same as that returned by the method. Classes derived from the class can override the method and return data that is different than what was contained in the original URI. Your application can mitigate memory Denial of Service threats to the method by implementing a wrapping implemented IStream that limits the number of bytes read. This helps to guard against situations where malicious code attempts to pass an infinite stream of bytes to the method.
Resolves external XML resources named by a Uniform Resource Identifier (URI).
Constructor 1.0.5000.0 2.0.0.0 4.0.0.0 This constructor is called by derived class constructors to initialize state in this type. Initializes a new instance of the class. 0 Property 1.0.5000.0 2.0.0.0 4.0.0.0 System.Net.ICredentials A instance containing the credentials. See for an example using this property. If the virtual directory does not require authentication, this property does not need to be set. Otherwise, the credentials of the user must be supplied. The following C# code sets credentials on the object. NetworkCredential nc = new NetWorkCredential(UserName,SecurelyStoredPassword,Domain); XmlUrlResolver resolver = new XmlUrlResolver(); resolver.Credentials = nc; Different credentials can be associated with different URIs and added to a credential cache. The credentials can then be used to check authentication for different URIs regardless of the original source of the XML. NetworkCredential myCred = new NetworkCredential(UserName,SecurelyStoredPassword,Domain); CredentialCache myCache = new CredentialCache(); myCache.Add(new Uri("http://www.contoso.com/"), "Basic", myCred); myCache.Add(new Uri("http://app.contoso.com/"), "Basic", myCred); XmlUrlResolver resolver = new XmlUrlResolver(); resolver.Credentials = myCache; When overridden in a derived class, sets the credentials used to authenticate Web requests. 0 Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Object is . is not a supported type. is . This method is used when the caller wants to map a given URI into the object containing the actual resource that the URI represents. The type of object returned is negotiable; however, the implementation must always support System.IO.Stream. For the asynchronous version of this method, see . Your application can mitigate memory Denial of Service threats to the method by implementing a wrapping implemented IStream that limits the number of bytes read. This helps to guard against situations where malicious code attempts to pass an infinite stream of bytes to the method. When overridden in a derived class, maps a URI to an object containing the actual resource. A object or null if a type other than stream is specified. The URI returned from . The current version does not use this parameter when resolving URIs. This is provided for future extensibility purposes. For example, this can be mapped to the xlink: role and used as an implementation specific argument in other scenarios. The type of object to return. The current version only returns System.IO.Stream objects. 0 Method 4.0.0.0 System.Threading.Tasks.Task<System.Object> This is the asynchronous version of , with the same functionality. To use this method, you must set the flag to true. Asynchronously maps a URI to an object containing the actual resource. A object or null if a type other than stream is specified. The URI returned from . The current version does not use this parameter when resolving URIs. This is provided for future extensibility purposes. For example, this can be mapped to the xlink: role and used as an implementation specific argument in other scenarios. The type of object to return. The current version only returns objects. Method 1.0.5000.0 2.0.0.0 4.0.0.0 System.Uri and are . and are . The absolute URI may be used as the base URI for any subsequent requests for entities that are relative to this URI. When overridden in a derived class, resolves the absolute URI from the base and relative URIs. A representing the absolute URI or null if the relative URI cannot be resolved. The base URI used to resolve the relative URI. The URI to resolve. The URI can be absolute or relative. If absolute, this value effectively replaces the value. If relative, it combines with the to make an absolute URI. 0 Method 4.0.0.0 System.Boolean To be added. Adds the ability for the resolver to return other types than just . true if the is supported; otherwise, false. The URI. The type to return. 0