-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move System.Runtime.Serialization.Formatters.Binary.BinaryFormatter to CoreLib #39090
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
|
I agree with @GrabYourPitchforks . System.Runtime.Serialization.Formatters.Binary.BinaryFormatter has problematic security characteristics. It is better for it to be in separate binary. |
Note that it is that small because the linker is removing all the methods from the type. This is because it can't automatically detect the above reflection usage and produces a warning (which we are currently ignoring all warnings). See the conversation here: #38432 (comment) |
If there aren't any objections, I'll experiment with sending a new iteration of #38963 that addresses this code path as well. |
@marek-safar These code paths should no longer be called in wasm applications, so there should be no remaining references to the Formatters package. Anything else we need to do here? |
I don't believe there is anything else we need to do here. After linking a Blazor WASM app with the latest runtime, I am not seeing |
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter type is always required by System.Private.CoreLib because it's used for resources serialization/deserialization. The required code after trimming in size sensitive scenarios ends up quite small (about 6kB) which indicates there is not a large chunk of code to be moved.
Moving the implementation would help reduce the number of file transfers for browser and get rid of extra reflection call in
runtime/src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.Core.cs
Lines 68 to 86 in 9907151
@eerhardt
The text was updated successfully, but these errors were encountered: