64 instantiations of BinaryFormatter
BinaryFormatTests (9)
FormatTests\FormattedObject\BinaryFormatWriterTests.cs (3)
27BinaryFormatter formatter = new(); 46BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 80BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
FormatTests\FormattedObject\HashTableTests.cs (1)
104BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
FormatTests\FormattedObject\ListTests.cs (1)
63BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
FormatTests\FormattedObject\PrimitiveTypeTests.cs (1)
100BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
SerializationRecordExtensionsTests.cs (3)
24BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 62BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 87BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
Microsoft.Build.Tasks.Core (1)
GenerateResource.cs (1)
2007BinaryFormatter binaryFormatter = new();
PresentationCore (2)
System\Windows\dataobject.cs (2)
1681formatter = new BinaryFormatter(); 3025formatter = new BinaryFormatter();
PresentationCore.Tests (6)
BinaryFormat\BinaryFormatWriterTests.cs (2)
26BinaryFormatter formatter = new(); 42BinaryFormatter formatter = new();
BinaryFormat\HashTableTests.cs (1)
105BinaryFormatter formatter = new();
BinaryFormat\ListTests.cs (1)
81BinaryFormatter formatter = new();
BinaryFormat\PrimitiveTypeTests.cs (1)
96BinaryFormatter formatter = new();
TestUtilities\BinaryFormatTestExtensions.cs (1)
26BinaryFormatter formatter = new();
PresentationFramework (1)
MS\Internal\DataStreams.cs (1)
390_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)
62new BinaryFormatter().Serialize(stream, data); 201value = new BinaryFormatter()
System.Private.Windows.Core.Tests (6)
System\Private\Windows\Nrbf\BinaryFormatterHelpers.cs (5)
40formatter = new(); 47formatter = new(selector, context); 70BinaryFormatter formatter = new() 104BinaryFormatter binaryFormatter = new() 135new BinaryFormatter().Serialize(stream, @object);
System\Private\Windows\Nrbf\CoreNrbfSerializerTests.cs (1)
47new BinaryFormatter().Serialize(stream, input);
System.Private.Windows.Core.TestUtilities (2)
BinarySerialization.cs (2)
120BinaryFormatter formatter = new() // CodeQL [SM04191]: Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 147BinaryFormatter 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)
1411new BinaryFormatter().Serialize(stream, serializationData); 1456new BinaryFormatter().Serialize(stream, serializationData); 1871object 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
System.Windows.Forms.Design.Tests (3)
System\ComponentModel\Design\ExceptionCollectionTests.cs (1)
52BinaryFormatter formatter = new();
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationServiceTests.cs (1)
694BinaryFormatter formatter = new();
System\ComponentModel\Design\Serialization\CodeDomSerializerExceptionTests.cs (1)
95BinaryFormatter formatter = new();
System.Windows.Forms.Tests (10)
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormattedObjectTests.cs (2)
79BinaryFormatter binaryFormatter = new() { Binder = new JsonDataTestDataBinder() }; 164BinaryFormatter binaryFormat = new(); // CodeQL [SM04191] This is a test deserialization process is performed on trusted data and the types are controlled and validated.
System\Windows\Forms\ImageListTests.cs (1)
446BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
System\Windows\Forms\Layout\TableLayoutSettingsTests.cs (3)
1790BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 1820BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 1842BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
System\Windows\Forms\ListViewGroupTests.cs (1)
1343BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
System\Windows\Forms\ListViewSubItemTests.cs (2)
585BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 586new BinaryFormatter().Serialize(stream, subItem);
System\Windows\Forms\OwnerDrawPropertyBagTests.cs (1)
119BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
84 references to BinaryFormatter
BinaryFormatTests (9)
FormatTests\FormattedObject\BinaryFormatWriterTests.cs (3)
27BinaryFormatter formatter = new(); 46BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 80BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
FormatTests\FormattedObject\HashTableTests.cs (1)
104BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
FormatTests\FormattedObject\ListTests.cs (1)
63BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
FormatTests\FormattedObject\PrimitiveTypeTests.cs (1)
100BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
SerializationRecordExtensionsTests.cs (3)
24BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 62BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 87BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
Microsoft.Build.Tasks.Core (1)
GenerateResource.cs (1)
2007BinaryFormatter binaryFormatter = new();
mscorlib (1)
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))]
PresentationCore (2)
System\Windows\dataobject.cs (2)
1660BinaryFormatter formatter; 3024BinaryFormatter formatter;
PresentationCore.Tests (9)
BinaryFormat\BinaryFormatWriterTests.cs (2)
26BinaryFormatter formatter = new(); 42BinaryFormatter formatter = new();
BinaryFormat\HashTableTests.cs (1)
105BinaryFormatter formatter = new();
BinaryFormat\ListTests.cs (1)
81BinaryFormatter formatter = new();
BinaryFormat\PrimitiveTypeTests.cs (1)
96BinaryFormatter formatter = new();
TestUtilities\BinaryFormatTestExtensions.cs (4)
14/// Serializes the object using the <see cref="BinaryFormatter"/> and reads it into a <see cref="SerializationRecord"/>. 19/// Serializes the object using the <see cref="BinaryFormatter"/>. 26BinaryFormatter formatter = new(); 34/// Returns `true` if the <see cref="Type"/> would use the <see cref="BinaryFormatter"/> for the purposes
PresentationFramework (2)
MS\Internal\DataStreams.cs (2)
384private BinaryFormatter Formatter 398static private 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)
69/// binary formatted content using either <see cref="BinaryFormatter"/> or System.Windows.Forms.BinaryFormat.Deserializer. 70/// To use <see cref="BinaryFormatter"/>, application should also opt in into the 84/// 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)
34/// 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)
22/// Thrown when <see cref="BinaryFormatter"/> is not supported. 73/// <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. 41/// Type resolver for use with <see cref="BinaryFormatter"/> and NRBF deserializers to restrict types
System.Private.Windows.Core.Tests (10)
System\Private\Windows\Nrbf\BinaryFormatterHelpers.cs (10)
16/// Provides helper methods for working with <see cref="BinaryFormatter"/>. 21/// Clones the specified object using <see cref="BinaryFormatter"/>. 37BinaryFormatter formatter; 61/// Serializes the specified object to a byte array using <see cref="BinaryFormatter"/>. 70BinaryFormatter formatter = new() 81/// Converts the specified object to a Base64 string using <see cref="BinaryFormatter"/>. 95/// Deserializes an object from a byte array using <see cref="BinaryFormatter"/>. 104BinaryFormatter binaryFormatter = new() 114/// Deserializes an object from a Base64 string using <see cref="BinaryFormatter"/>. 128/// Serializes the specified object to the provided stream using <see cref="BinaryFormatter"/>.
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)
61/// deserialized with <see cref="BinaryFormatter"/> with <paramref name="assemblyStyle"/> taken into account. 85/// <paramref name="object"/> is binary serialized using <see cref="BinaryFormatter"/> 104/// Serializes the specified object using <see cref="BinaryFormatter"/>. 120BinaryFormatter formatter = new() // CodeQL [SM04191]: Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 133/// Deserializes the specified stream using <see cref="BinaryFormatter"/>. 147BinaryFormatter 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">
System.Windows.Forms.Design.Tests (3)
System\ComponentModel\Design\ExceptionCollectionTests.cs (1)
52BinaryFormatter formatter = new();
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationServiceTests.cs (1)
694BinaryFormatter formatter = new();
System\ComponentModel\Design\Serialization\CodeDomSerializerExceptionTests.cs (1)
95BinaryFormatter formatter = new();
System.Windows.Forms.Primitives.TestUtilities (1)
System\Windows\Forms\BinaryFormat\BinaryFormatTestExtensions.cs (1)
13/// Returns `true` if the <see cref="Type"/> would use the <see cref="BinaryFormatter"/> for the purposes
System.Windows.Forms.Tests (9)
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormattedObjectTests.cs (2)
79BinaryFormatter binaryFormatter = new() { Binder = new JsonDataTestDataBinder() }; 164BinaryFormatter binaryFormat = new(); // CodeQL [SM04191] This is a test deserialization process is performed on trusted data and the types are controlled and validated.
System\Windows\Forms\ImageListTests.cs (1)
446BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
System\Windows\Forms\Layout\TableLayoutSettingsTests.cs (3)
1790BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 1820BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 1842BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
System\Windows\Forms\ListViewGroupTests.cs (1)
1343BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
System\Windows\Forms\ListViewSubItemTests.cs (1)
585BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
System\Windows\Forms\OwnerDrawPropertyBagTests.cs (1)
119BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.