Remove System.Net.Requests dependency from System.Private.Xml (dotnet/corefx#41111)
authorStephen Toub <stoub@microsoft.com>
Tue, 17 Sep 2019 14:43:51 +0000 (10:43 -0400)
committerGitHub <noreply@github.com>
Tue, 17 Sep 2019 14:43:51 +0000 (10:43 -0400)
commit508404b0f71a0157714e29e094e0fbb56c683349
tree16e9cb80c70099ed9c3748ee6bd1cc39539c18e2
parentdf771c4e0b7b4f439392ca02f84c4d509e0aece2
Remove System.Net.Requests dependency from System.Private.Xml (dotnet/corefx#41111)

* Remove System.Net.Requests dependency from System.Private.Xml

Anything that uses System.Xml ends up implicitly referencing this .dll, which in a trimmed default MVC app is 97K.  The only thing it's used for is as part of XmlResolver to download the specified url.  We can instead remove the usage of WebRequest.Create and replace it with usage of HttpClient, which is already brought in because System.Net.Requests uses it to implement HttpWebRequest.

* Address PR feedback

And other minor cleanup.  Also fix uap build.

Commit migrated from https://github.com/dotnet/corefx/commit/f873a33056ab318c02d295f816065a3d2ad3736b
src/libraries/System.Private.Xml/src/System.Private.Xml.csproj
src/libraries/System.Private.Xml/src/System/Xml/XmlDownloadManager.cs
src/libraries/System.Private.Xml/src/System/Xml/XmlDownloadManagerAsync.cs
src/libraries/System.Private.Xml/src/System/Xml/XmlUrlResolver.cs
src/libraries/System.Private.Xml/src/System/Xml/XmlUrlResolverAsync.cs
src/libraries/System.Private.Xml/tests/XmlReader/Tests/AsyncReaderLateInitTests.cs
src/libraries/System.Private.Xml/tests/XmlReader/XmlResolver/XmlSystemPathResolverTests.cs