From ce35b2e6d6f4b7a817f3d887db853811e54b735f Mon Sep 17 00:00:00 2001 From: Dan Moseley Date: Mon, 3 Apr 2017 05:44:48 -0700 Subject: [PATCH] Cut down FormatterServices (dotnet/coreclr#10653) Commit migrated from https://github.com/dotnet/coreclr/commit/fe7a5f082ca14f5945eedc8d0d23311c0d3701a0 --- .../Runtime/Serialization/FormatterServices.cs | 24 ++-------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/coreclr/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs b/src/coreclr/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs index 5f07c3a..1813932 100644 --- a/src/coreclr/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs +++ b/src/coreclr/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs @@ -29,6 +29,8 @@ using System.Diagnostics.Contracts; namespace System.Runtime.Serialization { + // This class duplicates a class on CoreFX. We are keeping it here -- just this one method -- + // as it was widely invoked by reflection to workaround it being missing in .NET Core 1.0 internal static class FormatterServices { // Gets a new instance of the object. The entire object is initalized to 0 and no @@ -56,28 +58,6 @@ namespace System.Runtime.Serialization [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern Object nativeGetUninitializedObject(RuntimeType type); - private static Binder s_binder = Type.DefaultBinder; - - /*============================LoadAssemblyFromString============================ - **Action: Loads an assembly from a given string. The current assembly loading story - ** is quite confusing. If the assembly is in the fusion cache, we can load it - ** using the stringized-name which we transmitted over the wire. If that fails, - ** we try for a lookup of the assembly using the simple name which is the first - ** part of the assembly name. If we can't find it that way, we'll return null - ** as our failure result. - **Returns: The loaded assembly or null if it can't be found. - **Arguments: assemblyName -- The stringized assembly name. - **Exceptions: None - ==============================================================================*/ - internal static Assembly LoadAssemblyFromString(String assemblyName) - { - // - // Try using the stringized assembly name to load from the fusion cache. - // - BCLDebug.Trace("SER", "[LoadAssemblyFromString]Looking for assembly: ", assemblyName); - Assembly found = Assembly.Load(assemblyName); - return found; - } } } -- 2.7.4