29 instantiations of BinaryFormatter
Microsoft.Private.Windows.Core (2)
System\Private\Windows\Ole\BinaryFormatUtilities.cs (2)
75new BinaryFormatter().Serialize(stream, data); 228value = new BinaryFormatter()
PresentationFramework (1)
MS\Internal\DataStreams.cs (1)
389_formatter = new BinaryFormatter();
System.ComponentModel.TypeConverter (2)
System\ComponentModel\Design\DesigntimeLicenseContextSerializer.cs (2)
58var formatter = new BinaryFormatter(); 140var formatter = new BinaryFormatter();
System.Configuration.ConfigurationManager (3)
System\Configuration\SettingsPropertyValue.cs (3)
99value = (new BinaryFormatter()).Deserialize(ms); 195return (new BinaryFormatter()).Deserialize(ms); 234BinaryFormatter bf = new BinaryFormatter();
System.Data.Common (2)
System\Data\DataSet.cs (2)
360BinaryFormatter bf = new BinaryFormatter(null, new StreamingContext(context.State, false)); 444BinaryFormatter bf = new BinaryFormatter(null, new StreamingContext(context.State, false));
System.Private.Windows.Core (2)
System\Private\Windows\Ole\BinaryFormatUtilities.cs (2)
75new BinaryFormatter().Serialize(stream, data); 228value = new BinaryFormatter()
System.Private.Windows.Core.TestUtilities (2)
BinarySerialization.cs (2)
123BinaryFormatter formatter = new() // CodeQL [SM04191]: Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 150BinaryFormatter formatter = new() // CodeQL [SM04191]: Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
System.Resources.Extensions (1)
System\Resources\Extensions\DeserializingResourceReader.cs (1)
49BinaryFormatter? formatter = new()
System.Windows.Forms (6)
System\Resources\ResXDataNode.cs (2)
293binaryFormatter ??= new BinaryFormatter 445_binaryFormatter ??= new BinaryFormatter
System\Windows\Forms\ActiveX\AxHost.PropertyBagStream.cs (2)
49_bag = (Hashtable)new BinaryFormatter().Deserialize(stream); // CodeQL[SM03722, SM04191] : BinaryFormatter is intended to be used as a fallback for unsupported types. Users must explicitly opt into this behavior" 118new BinaryFormatter().Serialize(stream, _bag);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (2)
1152deserialized = new BinaryFormatter().Deserialize(stream); // CodeQL[SM03722, SM04191] : BinaryFormatter is intended to be used as a fallback for unsupported types. Users must explicitly opt into this behavior 1538new BinaryFormatter().Serialize(stream, sourceValue);
System.Windows.Forms.Design (8)
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.cs (2)
167new BinaryFormatter().Serialize(_resourceStream, _resources.Data); 233Hashtable? resources = new BinaryFormatter().Deserialize(_resourceStream) as Hashtable; // CodeQL[SM03722, SM04191] : The operation is essential for the design experience when users are running their own designers they have created. This cannot be achieved without BinaryFormatter
System\Windows\Forms\Design\CommandSet.cs (3)
1405new BinaryFormatter().Serialize(stream, serializationData); 1450new BinaryFormatter().Serialize(stream, serializationData); 1865object serializationData = new BinaryFormatter().Deserialize(s); // CodeQL[SM03722, SM04191] : The operation is essential for the design experience when users are running their own designers they have created. This cannot be achieved without BinaryFormatter
System\Windows\Forms\Design\OleDragDropHandler.ComponentDataObject.cs (3)
54new BinaryFormatter().Serialize(_serializationStream, sd); 144return new BinaryFormatter().Deserialize(SerializationStream); // CodeQL[SM03722, SM04191] : The operation is essential for the design experience when users are running their own designers they have created. This cannot be achieved without BinaryFormatter 220_serializationData ??= new BinaryFormatter().Deserialize(SerializationStream!); // CodeQL[SM03722, SM04191] : The operation is essential for the design experience when users are running their own designers they have created. This cannot be achieved without BinaryFormatter
50 references to BinaryFormatter
Microsoft.Private.Windows.Core (10)
System\Private\Windows\CoreAppContextSwitches.cs (3)
75/// binary formatted content using either <see cref="BinaryFormatter"/> or System.Windows.Forms.BinaryFormat.Deserializer. 76/// To use <see cref="BinaryFormatter"/>, application should also opt in into the 90/// to deserialize the payload, if needed. If <see langword="false"/>, then <see cref="BinaryFormatter"/> is used
System\Private\Windows\FeatureSwitches.cs (2)
11/// Feature switch that wraps whether or not <see cref="BinaryFormatter"/> is enabled. 16/// the <see cref="BinaryFormatter"/>. Code past a feature switch isn't considered for warnings if the
System\Private\Windows\Nrbf\INrbfSerializer.cs (1)
43/// the <see cref="BinaryFormatter"/>. It is also used as the allowed list of types that we'll auto-bind when
System\Private\Windows\Ole\BinaryFormatUtilities.cs (2)
31/// Thrown when <see cref="BinaryFormatter"/> is not supported. 86/// <exception cref="NotSupportedException">Thrown when <see cref="BinaryFormatter"/> is not enabled.</exception>
System\Private\Windows\Ole\TypeBinder.cs (2)
28/// This class is used in <see cref="BinaryFormatter"/> and NRBF deserialization. 49/// Type resolver for use with <see cref="BinaryFormatter"/> and NRBF deserializers to restrict types
mscorlib (1)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
743[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.Formatters.Binary.BinaryFormatter))]
netstandard (1)
netstandard.cs (1)
1762[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.Formatters.Binary.BinaryFormatter))]
PresentationFramework (2)
MS\Internal\DataStreams.cs (2)
383private BinaryFormatter Formatter 397private static BinaryFormatter _formatter;
System.ComponentModel.TypeConverter (2)
System\ComponentModel\Design\DesigntimeLicenseContextSerializer.cs (2)
58var formatter = new BinaryFormatter(); 140var formatter = new BinaryFormatter();
System.Configuration.ConfigurationManager (1)
System\Configuration\SettingsPropertyValue.cs (1)
234BinaryFormatter bf = new BinaryFormatter();
System.Data.Common (2)
System\Data\DataSet.cs (2)
360BinaryFormatter bf = new BinaryFormatter(null, new StreamingContext(context.State, false)); 444BinaryFormatter bf = new BinaryFormatter(null, new StreamingContext(context.State, false));
System.Private.Windows.Core (10)
System\Private\Windows\CoreAppContextSwitches.cs (3)
75/// binary formatted content using either <see cref="BinaryFormatter"/> or System.Windows.Forms.BinaryFormat.Deserializer. 76/// To use <see cref="BinaryFormatter"/>, application should also opt in into the 90/// to deserialize the payload, if needed. If <see langword="false"/>, then <see cref="BinaryFormatter"/> is used
System\Private\Windows\FeatureSwitches.cs (2)
11/// Feature switch that wraps whether or not <see cref="BinaryFormatter"/> is enabled. 16/// the <see cref="BinaryFormatter"/>. Code past a feature switch isn't considered for warnings if the
System\Private\Windows\Nrbf\INrbfSerializer.cs (1)
43/// the <see cref="BinaryFormatter"/>. It is also used as the allowed list of types that we'll auto-bind when
System\Private\Windows\Ole\BinaryFormatUtilities.cs (2)
31/// Thrown when <see cref="BinaryFormatter"/> is not supported. 86/// <exception cref="NotSupportedException">Thrown when <see cref="BinaryFormatter"/> is not enabled.</exception>
System\Private\Windows\Ole\TypeBinder.cs (2)
28/// This class is used in <see cref="BinaryFormatter"/> and NRBF deserialization. 49/// Type resolver for use with <see cref="BinaryFormatter"/> and NRBF deserializers to restrict types
System.Private.Windows.Core.TestUtilities (9)
AppContextSwitchNames.cs (2)
11/// The switch that controls whether or not the <see cref="BinaryFormatter"/> is enabled. 24/// The switch that controls whether or not the <see cref="BinaryFormatter"/> is enabled in the
BinaryFormatterScope.cs (1)
9/// Scope for enabling / disabling the <see cref="BinaryFormatter"/>. Use in a <see langword="using"/> statement.
BinarySerialization.cs (6)
64/// deserialized with <see cref="BinaryFormatter"/> with <paramref name="assemblyStyle"/> taken into account. 88/// <paramref name="object"/> is binary serialized using <see cref="BinaryFormatter"/> 107/// Serializes the specified object using <see cref="BinaryFormatter"/>. 123BinaryFormatter formatter = new() // CodeQL [SM04191]: Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 136/// Deserializes the specified stream using <see cref="BinaryFormatter"/>. 150BinaryFormatter formatter = new() // CodeQL [SM04191]: Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
System.Resources.Extensions (1)
System\Resources\Extensions\DeserializingResourceReader.cs (1)
49BinaryFormatter? formatter = new()
System.Windows.Forms (11)
System\Resources\ResXDataNode.cs (1)
37private BinaryFormatter? _binaryFormatter;
System\Windows\Forms\ActiveX\AxHost.PropertyBagStream.cs (1)
53Debug.Fail($"PropertyBagStream: {nameof(BinaryFormatter)} failed with {inner.Message}");
System\Windows\Forms\OLE\Clipboard.cs (9)
154/// overload of TryGetData that has the possibility of falling back to the <see cref="BinaryFormatter"/> and 155/// should only be used if you need <see cref="BinaryFormatter"/> support. 211/// This API will fall back to the <see cref="BinaryFormatter"/> if the application has enabled it and taken 215/// <see cref="BinaryFormatter"/>. 220/// the <see cref="BinaryFormatter"/>. <see href="https://learn.microsoft.com/openspecs/windows_protocols/ms-nrbf/4e77849f-89e3-49db-8fb9-e77ee4bc7214"> 247/// If application does not support <see cref="BinaryFormatter"/> and the object can't be deserialized otherwise, or 248/// application supports <see cref="BinaryFormatter"/> but <typeparamref name="T"/> is an <see cref="object"/>, 324/// This method will never allow falling back to the <see cref="BinaryFormatter"/>, even if it is fully enabled. 330/// the <see cref="BinaryFormatter"/>. <see href="https://learn.microsoft.com/openspecs/windows_protocols/ms-nrbf/4e77849f-89e3-49db-8fb9-e77ee4bc7214">