standard net framework entre diferencias clases biblioteca and .net .net-core .net-framework-version .net-standard

entre - ¿Cuáles son las 43 API que están en.Net Standard 2.0 pero no en.Net Framework 4.6.1?



net standard target framework (2)

La pregunta de SO titulada .NET Standard API Reference , citando la discusión en https://github.com/dotnet/standard/issues/133 , menciona 43 API que se incluirán en .Net Standard 2.0 pero no son compatibles con .Net Marco 4.6.1. Sin embargo, no he podido encontrar una lista de esas 43 API en ningún lugar de Internet. Lo más cercano que he encontrado en mi búsqueda es https://github.com/dotnet/standard/blob/master/docs/versions/netstandard1.5_diff.md y https://github.com/dotnet/standard/blob/master/docs/versions/netstandard1.6_diff.md , que enumera las API introducidas en .Net Standard 1.5 y 1.6. Al principio pensé que mi búsqueda había terminado, pero luego me di cuenta:

  1. Hay más de 43 API en esas dos listas, y
  2. Muchos de ellos ya son compatibles con .Net Framework 4.6.1.

¿Hay, en algún lugar de Internet, una lista de las 43 API específicas incluidas en .Net Standard 2.0 pero no incluidas en .Net Framework 4.6.1?


Publiqué una pregunta similar en el proyecto .Net Standard.

Todos los créditos goto @benaadams

Puede encontrar las apis que faltan en: ApiCompatBaseline.net461.txt

Revisé el archivo y encontré 52 entradas (más de 43!).

Las 52 API que faltan son:

Member ''System.AppContext.GetData(System.String)'' Member ''System.AppContext.TargetFrameworkName.get()'' Type ''System.StringNormalizationExtensions'' Type ''System.Data.Common.DbColumn'' Type ''System.Data.Common.DbDataReaderExtensions'' Type ''System.Data.Common.IDbColumnSchemaGenerator'' Type ''System.Diagnostics.StackFrameExtensions'' Type ''System.Diagnostics.Tracing.EventCounter'' Member ''System.Diagnostics.Tracing.EventSource.add_EventCommandExecuted(System.EventHandler<System.Diagnostics.Tracing.EventCommandEventArgs>)'' Member ''System.Diagnostics.Tracing.EventSource.remove_EventCommandExecuted(System.EventHandler<System.Diagnostics.Tracing.EventCommandEventArgs>)'' Type ''System.Globalization.GlobalizationExtensions'' Member ''System.Linq.Enumerable.Append<TSource>(System.Collections.Generic.IEnumerable<TSource>, TSource)'' Member ''System.Linq.Enumerable.Prepend<TSource>(System.Collections.Generic.IEnumerable<TSource>, TSource)'' Member ''System.Linq.Expressions.Expression<TDelegate>.Compile(System.Boolean)'' Member ''System.Linq.Expressions.LambdaExpression.Compile(System.Boolean)'' Member ''System.Net.Http.HttpClientHandler.CheckCertificateRevocationList.get()'' Member ''System.Net.Http.HttpClientHandler.CheckCertificateRevocationList.set(System.Boolean)'' Member ''System.Net.Http.HttpClientHandler.ClientCertificates.get()'' Member ''System.Net.Http.HttpClientHandler.DefaultProxyCredentials.get()'' Member ''System.Net.Http.HttpClientHandler.DefaultProxyCredentials.set(System.Net.ICredentials)'' Member ''System.Net.Http.HttpClientHandler.MaxConnectionsPerServer.get()'' Member ''System.Net.Http.HttpClientHandler.MaxConnectionsPerServer.set(System.Int32)'' Member ''System.Net.Http.HttpClientHandler.MaxResponseHeadersLength.get()'' Member ''System.Net.Http.HttpClientHandler.MaxResponseHeadersLength.set(System.Int32)'' Member ''System.Net.Http.HttpClientHandler.Properties.get()'' Member ''System.Net.Http.HttpClientHandler.ServerCertificateCustomValidationCallback.get()'' Member ''System.Net.Http.HttpClientHandler.ServerCertificateCustomValidationCallback.set(System.Func<System.Net.Http.HttpRequestMessage, System.Security.Cryptography.X509Certificates.X509Certificate2, System.Security.Cryptography.X509Certificates.X509Chain, System.Net.Security.SslPolicyErrors, System.Boolean>)'' Member ''System.Net.Http.HttpClientHandler.SslProtocols.get()'' Member ''System.Net.Http.HttpClientHandler.SslProtocols.set(System.Security.Authentication.SslProtocols)'' Type ''System.Net.Sockets.SocketReceiveFromResult'' Type ''System.Net.Sockets.SocketReceiveMessageFromResult'' Type ''System.Net.Sockets.SocketTaskExtensions'' Type ''System.Runtime.Serialization.DataContractSerializerExtensions'' Type ''System.Runtime.Serialization.ISerializationSurrogateProvider'' Type ''System.Security.SecureStringMarshal'' Type ''System.Security.Cryptography.ECCurve'' Member ''System.Security.Cryptography.ECDsa.Create(System.Security.Cryptography.ECCurve)'' Member ''System.Security.Cryptography.ECDsa.Create(System.Security.Cryptography.ECParameters)'' Member ''System.Security.Cryptography.ECDsa.ExportExplicitParameters(System.Boolean)'' Member ''System.Security.Cryptography.ECDsa.ExportParameters(System.Boolean)'' Member ''System.Security.Cryptography.ECDsa.GenerateKey(System.Security.Cryptography.ECCurve)'' Member ''System.Security.Cryptography.ECDsa.ImportParameters(System.Security.Cryptography.ECParameters)'' Type ''System.Security.Cryptography.ECParameters'' Type ''System.Security.Cryptography.ECPoint'' Type ''System.Security.Cryptography.IncrementalHash'' Member ''System.Text.RegularExpressions.Regex.CapNames.get()'' Member ''System.Text.RegularExpressions.Regex.CapNames.set(System.Collections.IDictionary)'' Member ''System.Text.RegularExpressions.Regex.Caps.get()'' Member ''System.Text.RegularExpressions.Regex.Caps.set(System.Collections.IDictionary)'' Type ''System.Threading.PreAllocatedOverlapped'' Type ''System.Threading.ThreadPoolBoundHandle'' Type ''System.Xml.XPath.XDocumentExtensions''

Revisé la mayoría de estas API y encontré que no están disponibles en net461, pero están disponibles en netstandard2

Se espera que las API faltantes se implementen en .Net Framework 7.1 .NET Framework 4.7.1 proporciona soporte integrado para .NET Standard 2.0

El .NET Framework 4.7.1 Acceso temprano

Actualización noviembre, 2017:

Con la versión final de .NET Framework 4.7.1 , se implementan todas las API que faltan en 4.6.1.

Lista de API implementadas

Ahora .Net Standard 2.0 está integrado directamente en .NET Framework 4.7.1 sin la necesidad de instalar .Net Standard 2.0 binarios compatibles.


Usando https://apisof.net y comparándolo con todas las API enumeradas en https://github.com/dotnet/standard/blob/master/docs/versions/netstandard1.5_diff.md y https://github.com/dotnet/standard/blob/master/docs/versions/netstandard1.6_diff.md , me las arreglé para armar una lista de las API presentes en .Net Standard 1.6 pero que faltan en .Net Framework 4.6.1:

  • System.Diagnostics.Tracing.EventCounter :
    • public EventCounter(string name, EventSource eventSource) (no en .Net Framework)
    • public void WriteMetric(float value) (no en .Net Framework)
  • System.Diagnostics.Tracing.EventSource :
    • public event EventHandler<EventCommandEventArgs> EventCommandExecuted (en .Net Framework 4.6.2, pero no 4.6.1)
  • System.IO.BufferedStream :
    • public int BufferSize { get; } public int BufferSize { get; } (no en .Net Framework)
    • public Stream UnderlyingStream { get; } public Stream UnderlyingStream { get; } (no en .Net Framework)
  • System.Reflection.TypeInfo : todas las siguientes API, ninguna de las cuales está en .Net Framework

    public virtual bool IsCOMObject { get; } public override MemberTypes MemberType { get; } public virtual StructLayoutAttribute StructLayoutAttribute { get; } public ConstructorInfo TypeInitializer { get; } public virtual Type UnderlyingSystemType { get; } public virtual Type[] FindInterfaces(TypeFilter filter, object filterCriteria); public virtual MemberInfo[] FindMembers(MemberTypes memberType, BindingFlags bindingAttr, MemberFilter filter, object filterCriteria); public ConstructorInfo GetConstructor(Type[] types); public ConstructorInfo[] GetConstructors(); public virtual ConstructorInfo[] GetConstructors(BindingFlags bindingAttr); public virtual MemberInfo[] GetDefaultMembers(); public virtual string GetEnumName(object value); public virtual string[] GetEnumNames(); public virtual Type GetEnumUnderlyingType(); public virtual Array GetEnumValues(); public EventInfo GetEvent(string name); public virtual EventInfo GetEvent(string name, BindingFlags bindingAttr); public virtual EventInfo[] GetEvents(); public virtual EventInfo[] GetEvents(BindingFlags bindingAttr); public FieldInfo GetField(string name); public virtual FieldInfo GetField(string name, BindingFlags bindingAttr); public FieldInfo[] GetFields(); public virtual FieldInfo[] GetFields(BindingFlags bindingAttr); public virtual Type[] GetGenericArguments(); public Type GetInterface(string name); public virtual Type GetInterface(string name, bool ignoreCase); public virtual Type[] GetInterfaces(); public MemberInfo[] GetMember(string name); public virtual MemberInfo[] GetMember(string name, BindingFlags bindingAttr); public virtual MemberInfo[] GetMember(string name, MemberTypes type, BindingFlags bindingAttr); public MemberInfo[] GetMembers(); public virtual MemberInfo[] GetMembers(BindingFlags bindingAttr); public MethodInfo GetMethod(string name); public MethodInfo GetMethod(string name, BindingFlags bindingAttr); public MethodInfo GetMethod(string name, Type[] types); public MethodInfo GetMethod(string name, Type[] types, ParameterModifier[] modifiers); public MethodInfo[] GetMethods(); public virtual MethodInfo[] GetMethods(BindingFlags bindingAttr); public Type GetNestedType(string name); public virtual Type GetNestedType(string name, BindingFlags bindingAttr); public Type[] GetNestedTypes(); public virtual Type[] GetNestedTypes(BindingFlags bindingAttr); public PropertyInfo[] GetProperties(); public virtual PropertyInfo[] GetProperties(BindingFlags bindingAttr); public PropertyInfo GetProperty(string name); public PropertyInfo GetProperty(string name, BindingFlags bindingAttr); public PropertyInfo GetProperty(string name, Type returnType); public PropertyInfo GetProperty(string name, Type returnType, Type[] types); public PropertyInfo GetProperty(string name, Type returnType, Type[] types, ParameterModifier[] modifiers); public PropertyInfo GetProperty(string name, Type[] types); public virtual bool IsAssignableFrom(Type c); public virtual bool IsEnumDefined(object value); public virtual bool IsEquivalentTo(Type other); public virtual bool IsInstanceOfType(object o);

  • System.AppContext :
    • public static string TargetFrameworkName { get; } public static string TargetFrameworkName { get; } (no en .Net Framework)
    • public static object GetData(string name) (no en .Net Framework)
  • System.Linq.Enumerable :
    • public static IEnumerable<TSource> Append<TSource>(this IEnumerable<TSource> source, TSource element) (no en .Net Framework)
    • public static IEnumerable<TSource> Prepend<TSource>(this IEnumerable<TSource> source, TSource element) (no en .Net Framework)
  • System.Security.Cryptography.ECCurve : estructura ECCurve completa, y todo lo que contiene (incluida la clase estática System.Security.Cryptography.ECCurve.NamedCurves ), no están en .Net Framework. En otras palabras, todas las API en la siguiente lista son nuevas en .Net Core y no se pueden encontrar en .Net Framework 4.6.1 (o 4.6.2):

    public struct ECCurve { public enum ECCurveType { Characteristic2 = 4, Implicit = 0, Named = 5, PrimeMontgomery = 3, PrimeShortWeierstrass = 1, PrimeTwistedEdwards = 2, } public static class NamedCurves { public static ECCurve brainpoolP160r1 { get; } public static ECCurve brainpoolP160t1 { get; } public static ECCurve brainpoolP192r1 { get; } public static ECCurve brainpoolP192t1 { get; } public static ECCurve brainpoolP224r1 { get; } public static ECCurve brainpoolP224t1 { get; } public static ECCurve brainpoolP256r1 { get; } public static ECCurve brainpoolP256t1 { get; } public static ECCurve brainpoolP320r1 { get; } public static ECCurve brainpoolP320t1 { get; } public static ECCurve brainpoolP384r1 { get; } public static ECCurve brainpoolP384t1 { get; } public static ECCurve brainpoolP512r1 { get; } public static ECCurve brainpoolP512t1 { get; } public static ECCurve nistP256 { get; } public static ECCurve nistP384 { get; } public static ECCurve nistP521 { get; } } public byte[] A; public byte[] B; public byte[] Cofactor; public ECCurve.ECCurveType CurveType; public ECPoint G; public Nullable<HashAlgorithmName> Hash; public byte[] Order; public byte[] Polynomial; public byte[] Prime; public byte[] Seed; public bool IsCharacteristic2 { get; } public bool IsExplicit { get; } public bool IsNamed { get; } public bool IsPrime { get; } public Oid Oid { get; } public static ECCurve CreateFromFriendlyName(string oidFriendlyName); public static ECCurve CreateFromOid(Oid curveOid); public static ECCurve CreateFromValue(string oidValue); public void Validate(); }

  • System.Security.Cryptography.ECParameters struct: no en .Net Framework
  • Estructura System.Security.Cryptography.ECPoint : no en .Net Framework
  • System.Security.Cryptography.ECDsa :
    • public static ECDsa Create(ECCurve curve) (no en .Net Framework)
    • public static ECDsa Create(ECParameters parameters) (no en .Net Framework)
    • public virtual ECParameters ExportExplicitParameters(bool includePrivateParameters) (no en .Net Framework)
    • public virtual ECParameters ExportParameters(bool includePrivateParameters) (no en .Net Framework)
    • public virtual void GenerateKey(ECCurve curve) (no en .Net Framework)
    • public virtual void ImportParameters(ECParameters parameters) (no en .Net Framework)
  • System.Text.RegularExpressions.Regex :
    • protected IDictionary CapNames { get; set; } protected IDictionary CapNames { get; set; } (no en .Net Framework)
    • protected IDictionary Caps { get; set; } protected IDictionary Caps { get; set; } (no en .Net Framework)

Eso es mucho más que 43 APIs. Todavía no he revisado la lista de API de .Net Standard 2.0 (es enorme ); Una vez que lo haga, editaré esta respuesta para reflejar lo que encuentro.