64 instantiations of BinaryFormatter
BinaryFormatTests (10)
FormatTests\Common\SerializationTest.cs (1)
19BinaryFormatter formatter = new()
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)
23BinaryFormatter 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. 61BinaryFormatter 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. 86BinaryFormatter 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.Framework (2)
BinaryTranslator.cs (2)
508BinaryFormatter formatter = new BinaryFormatter(); 1209BinaryFormatter formatter = new BinaryFormatter();
MSBuildTaskHost (2)
BinaryTranslator.cs (2)
508BinaryFormatter formatter = new BinaryFormatter(); 1209BinaryFormatter formatter = new BinaryFormatter();
PresentationCore (2)
System\Windows\dataobject.cs (2)
1685formatter = new BinaryFormatter(); 3050formatter = new BinaryFormatter();
PresentationCore.Tests (7)
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\BinaryFormatterScope.cs (1)
40BinaryFormatter formatter = new();
TestUtilities\BinaryFormatTestExtensions.cs (1)
26BinaryFormatter formatter = new();
PresentationFramework (1)
MS\Internal\DataStreams.cs (1)
393_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.TestUtilities (2)
BinarySerialization.cs (2)
78BinaryFormatter binaryFormatter = new() // CodeQL [SM04191] : Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 106BinaryFormatter binaryFormatter = 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 (8)
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\OLE\DataObject.Composition.BinaryFormatUtilities.cs (2)
63new BinaryFormatter().Serialize(stream, data); 229return new BinaryFormatter()
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)
50BinaryFormatter formatter = new();
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationServiceTests.cs (1)
690BinaryFormatter formatter = new();
System\ComponentModel\Design\Serialization\CodeDomSerializerExceptionTests.cs (1)
93BinaryFormatter formatter = new();
System.Windows.Forms.Primitives.TestUtilities (1)
System\Windows\Forms\BinaryFormat\BinaryFormatTestExtensions.cs (1)
30BinaryFormatter formatter = new();
System.Windows.Forms.Tests (10)
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormattedObjectTests.cs (2)
70BinaryFormatter binaryFormatter = new() { Binder = new JsonDataTestDataBinder() }; 153BinaryFormatter 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)
444BinaryFormatter 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)
1788BinaryFormatter 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. 1818BinaryFormatter 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. 1840BinaryFormatter 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)
1341BinaryFormatter 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)
583BinaryFormatter 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. 584new BinaryFormatter().Serialize(stream, subItem);
System\Windows\Forms\OwnerDrawPropertyBagTests.cs (1)
117BinaryFormatter 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.
74 references to BinaryFormatter
BinaryFormatTests (10)
FormatTests\Common\SerializationTest.cs (1)
19BinaryFormatter formatter = new()
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)
23BinaryFormatter 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. 61BinaryFormatter 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. 86BinaryFormatter 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.Framework (2)
BinaryTranslator.cs (2)
508BinaryFormatter formatter = new BinaryFormatter(); 1209BinaryFormatter formatter = new BinaryFormatter();
MSBuildTaskHost (2)
BinaryTranslator.cs (2)
508BinaryFormatter formatter = new BinaryFormatter(); 1209BinaryFormatter formatter = new BinaryFormatter();
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)
1664BinaryFormatter formatter; 3049BinaryFormatter formatter;
PresentationCore.Tests (12)
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\AppContextSwitchNames.cs (1)
11/// The switch that controls whether or not the <see cref="BinaryFormatter"/> is enabled.
TestUtilities\BinaryFormatterScope.cs (2)
9/// Scope for enabling / disabling the <see cref="BinaryFormatter"/>. Use in a <see langword="using"/> statement. 40BinaryFormatter 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)
387private BinaryFormatter Formatter 401static 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.TestUtilities (7)
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 (4)
59/// deserialized with <see cref="BinaryFormatter"/> with <paramref name="assemblyStyle"/> taken into account. 78BinaryFormatter binaryFormatter = new() // CodeQL [SM04191] : Safe use because the deserialization process is performed on trusted data and the types are controlled and validated. 93/// <paramref name="object"/> is binary serialized using <see cref="BinaryFormatter"/> 106BinaryFormatter binaryFormatter = 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 (10)
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 (5)
253/// This is an alternative to <see cref="GetData(string)"/> that uses <see cref="BinaryFormatter"/> only when application 255/// By default the NRBF deserializer attempts to deserialize the stream. It can be disabled in favor of <see cref="BinaryFormatter"/> 316/// <see cref="Runtime.CompilerServices.TypeForwardedFromAttribute"/>. <see cref="BinaryFormatter"/> serializes these types 333/// If application does not support <see cref="BinaryFormatter"/> and the object can't be deserialized otherwise, or 334/// application supports <see cref="BinaryFormatter"/> but <typeparamref name="T"/> is an <see cref="object"/>,
System\Windows\Forms\OLE\DataObject.Composition.Binder.cs (2)
26/// This class is used in <see cref="BinaryFormatter"/> and NRBF deserialization. 113/// Type resolver for use with <see cref="BinaryFormatter"/> and NRBF deserializers to restrict types
System\Windows\Forms\OLE\ITypedDataObject.cs (1)
51/// <see cref="BinaryFormatter"/> compatible overload that retrieves typed data associated with the specified data format.
System.Windows.Forms.Design.Tests (3)
System\ComponentModel\Design\ExceptionCollectionTests.cs (1)
50BinaryFormatter formatter = new();
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationServiceTests.cs (1)
690BinaryFormatter formatter = new();
System\ComponentModel\Design\Serialization\CodeDomSerializerExceptionTests.cs (1)
93BinaryFormatter formatter = new();
System.Windows.Forms.Primitives (3)
System\LocalAppContextSwitches\LocalAppContextSwitches.cs (3)
234/// binary formatted content using either <see cref="BinaryFormatter"/> or System.Windows.Forms.BinaryFormat.Deserializer. 235/// To use <see cref="BinaryFormatter"/>, application should also opt in into the 249/// to deserialize the payload, if needed. If <see langword="false"/>, then <see cref="BinaryFormatter"/> is used
System.Windows.Forms.Primitives.TestUtilities (4)
System\Windows\Forms\BinaryFormat\BinaryFormatTestExtensions.cs (4)
14/// Serializes the object using the <see cref="BinaryFormatter"/> and reads it into a <see cref="SerializationRecord"/>. 23/// Serializes the object using the <see cref="BinaryFormatter"/>. 30BinaryFormatter formatter = new(); 38/// 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)
70BinaryFormatter binaryFormatter = new() { Binder = new JsonDataTestDataBinder() }; 153BinaryFormatter 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)
444BinaryFormatter 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)
1788BinaryFormatter 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. 1818BinaryFormatter 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. 1840BinaryFormatter 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)
1341BinaryFormatter 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)
583BinaryFormatter 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)
117BinaryFormatter 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.