-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Remove System.Net.Requests dependency from System.Private.Xml #41111
Conversation
"System.Net.WebRequest" - What is that? Maybe you meant to say "push WebException to a lower-assembly"? I don't think we want the WebRequest family of APIs (which are considered the 'legacy' APIs) pushed into System.Net.Primitives. |
src/System.Private.Xml/tests/XmlReader/XmlResolver/XmlSystemPathResolverTests.cs
Outdated
Show resolved
Hide resolved
Typo, I meant WebException. Fixed. |
I'm fine with the breaking change but we need to make sure it's documented later down the cycle and since already labeled as such then plan sounds good to me (haven't looked at the changeset yet). |
@ericstj how should we record breaking changes for 5.0? Label on PR? |
I cannot say how much it is used for downloading ftp resource, but seems it is used some level https://forums.asp.net/t/1378012.aspx?Using+XDocument+Load+to+read+a+file+from+an+FTP+address XmlUrlResolver res = new XmlUrlResolver();
res.Credentials = new NetworkCredential("username", "password");
XmlReaderSettings set = new XmlReaderSettings();
set.XmlResolver = res;
XmlReader reader = XmlReader.Create("ftp://host.test", set)); Looks this is the only method for downloading external resource of XmlUrlResolver so |
Note that this is from 2009 and since then new apps (I believe) are mostly using JSON. Also we won't change full framework behavior and to workaround the problem customer can create a stream themselves and pass it to XmlReader or for more advanced scenarios create a custom XmlResolver which did what it used to (we can even put the implementation in the sample or breaking change docs if needed). I wouldn't keep dependency to FTP given the workarounds and combined with the fact that we discourage people from using XmlResolver completely for security reasons. |
Yeah, then we'll need to generate docs from those PRs by the time we ship. |
Is there some place I should proactively be adding content to, other than adding the breaking change label (which I've already done)? Thanks. |
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.
c4933b4
to
33ddce7
Compare
src/System.Private.Xml/tests/XmlReader/XmlResolver/XmlSystemPathResolverTests.cs
Outdated
Show resolved
Hide resolved
And other minor cleanup. Also fix uap build.
33ddce7
to
dd1949a
Compare
…/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 dotnet/corefx@f873a33
Anything that uses System.Xml ends up implicitly referencing this System.Net.Requests.dll, which in a trimmed default MVC app is 97K (plus, System.Net.Requests.dll in turn references a whole bunch of stuff that's otherwise unused). 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.
@krwq, @buyaa-n, there are two breaking changes here (which is also why I've temporarily marked this as no-merge, until we can discuss it appropriately):
cc: @jkotas, @davidsh, @danmosemsft