Option to not use WebRequest for PictureBox#6684
Conversation
src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Igor Velikorossov <RussKie@users.noreply.github.com>
Co-authored-by: Igor Velikorossov <RussKie@users.noreply.github.com>
|
If subsequently apply kant2002@7ce82f2 then application trimmed to 15Mb and that with reflection |
src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs
Outdated
Show resolved
Hide resolved
|
@RussKie do you think, this PR require some additional work? |
|
Apologies for the delay, I’m working on multiple streams and stretched pretty thin atm. I’ll try to get to this asapp.
|
JeremyKuhne
left a comment
There was a problem hiding this comment.
I'd stick with putting this in the existing Task.Run and avoid introducing async.
|
@JeremyKuhne did I infer your proposal correctly? |
src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs
Outdated
Show resolved
Hide resolved
JeremyKuhne
left a comment
There was a problem hiding this comment.
Spending some more time looking at this I think you'd be better off using the existing ReadCallBack(). Let me know if that doesn't work for you or if you have any other questions.
|
@kant2002 appreciate your effort here. |
|
@JeremyKuhne reason why I did use Anyway, I update as you suggest the code. I do not have questions and this approach is fine. |
Normally, I'd agree. As this code predates
I think the default position should be "no differences in functionality". We can, of course, alter that based on data and discussion. Again, thanks for your effort here. |
Indirectly related to #1756 because if that would work, I would be able to fix #1756 using the same approach.
WebRequest bring ton of code to WinForms which is old, and not really interesting. NativeAOT suffer from this.
Inspired by dotnet/runtime#38397
By itself if applying
<RuntimeHostConfigurationOption Include="System.Windows.Forms.PictureBox.UseWebRequest" Value="false" Trim="true" />it will shave 1Mb from 20Mb of my sample application which compiled under NativeAOT. I include all controls in that application.Microsoft Reviewers: Open in CodeFlow