File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
src/libraries/System.Resources.Extensions/src/System/Resources/Extensions Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 33
44using System . ComponentModel ;
55using System . IO ;
6+ using System . Resources . Extensions . BinaryFormat ;
67using System . Runtime . Serialization ;
78using System . Runtime . Serialization . Formatters . Binary ;
89
@@ -12,11 +13,6 @@ public partial class DeserializingResourceReader
1213 {
1314 private bool _assumeBinaryFormatter ;
1415
15- // Issue https://github.com/dotnet/runtime/issues/39292 tracks finding an alternative to BinaryFormatter
16- #pragma warning disable SYSLIB0011
17- private BinaryFormatter ? _formatter ;
18- #pragma warning restore SYSLIB0011
19-
2016 private bool ValidateReaderType ( string readerType )
2117 {
2218 // our format?
@@ -41,12 +37,13 @@ private bool ValidateReaderType(string readerType)
4137#pragma warning disable SYSLIB0011
4238 private object ReadBinaryFormattedObject ( )
4339 {
44- _formatter ??= new BinaryFormatter ( )
45- {
46- Binder = new UndoTruncatedTypeNameSerializationBinder ( )
47- } ;
40+ BinaryFormattedObject binaryFormattedObject = new BinaryFormattedObject ( _store . BaseStream ,
41+ new BinaryFormattedObject . Options ( )
42+ {
43+ Binder = new UndoTruncatedTypeNameSerializationBinder ( )
44+ } ) ;
4845
49- return _formatter . Deserialize ( _store . BaseStream ) ;
46+ return binaryFormattedObject . Deserialize ( ) ;
5047 }
5148#pragma warning restore SYSLIB0011
5249
You can’t perform that action at this time.
0 commit comments