.Net Standard 2.0 中但 .Net Framework 4.6.1 中没有的 43 个 API 是什么? [英] What are the 43 APIs that are in .Net Standard 2.0 but not in .Net Framework 4.6.1?

查看:24
本文介绍了.Net Standard 2.0 中但 .Net Framework 4.6.1 中没有的 43 个 API 是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

题为 .NET 标准 API 参考的 SO 问题,引用了 https://github.com/dotnet/standard/issues/133,提到了将包含在 .Net 标准中的 43 个 API2.0 但不受 .Net Framework 4.6.1 支持.但是,我无法在 Internet 上的任何地方找到这 43 个 API 的列表.我在搜索中最接近的是 https://github.com/dotnet/standard/blob/master/docs/versions/netstandard1.5_diff.mdhttps://github.com/dotnet/standard/blob/master/docs/versions/netstandard1.6_diff.md,其中列出了在.Net 标准 1.5 和 1.6.一开始我以为我的搜索结束了,但后来我意识到:

The SO question entitled .NET Standard API Reference, quoting the discussion in https://github.com/dotnet/standard/issues/133, mentions 43 APIs that will be included in the .Net Standard 2.0 but are not supported by .Net Framework 4.6.1. However, I have not been able to find a list of those 43 APIs anywhere on the Internet. The closest I've come in my search is https://github.com/dotnet/standard/blob/master/docs/versions/netstandard1.5_diff.md and https://github.com/dotnet/standard/blob/master/docs/versions/netstandard1.6_diff.md, which list the APIs introduced in .Net Standard 1.5 and 1.6. At first I thought my search was over, but then I realized:

  1. 这两个列表中有超过 43 个 API,并且
  2. 其中许多已被 .Net Framework 4.6.1 支持.

互联网上是否有任何地方的 43 个特定 API 列表,这些 API 包含在 .Net Standard 2.0 中但未包含在 .Net Framework 4.6.1 中?

Is there, anywhere on the Internet, a list of the 43 specific APIs that are included in .Net Standard 2.0 but not included in .Net Framework 4.6.1?

推荐答案

通过使用 https://apisof.net 和根据 https://github 中列出的每个 API 检查它.com/dotnet/standard/blob/master/docs/versions/netstandard1.5_diff.mdhttps://github.com/dotnet/standard/blob/master/docs/versions/netstandard1.6_diff.md,我设法整理了一个列表.Net Standard 1.6 中存在但 .Net Framework 4.6.1 中缺失的 API:

By using https://apisof.net and checking it against every API listed in https://github.com/dotnet/standard/blob/master/docs/versions/netstandard1.5_diff.md and https://github.com/dotnet/standard/blob/master/docs/versions/netstandard1.6_diff.md, I've managed to put together a list of the APIs present in .Net Standard 1.6 but missing in .Net Framework 4.6.1:

  • System.Diagnostics.Tracing.EventCounter:
    • public EventCounter(string name, EventSource eventSource)(不在 .Net Framework 中)
    • public void WriteMetric(float value)(不在 .Net Framework 中)
    • System.Diagnostics.Tracing.EventCounter:
      • public EventCounter(string name, EventSource eventSource) (not in .Net Framework)
      • public void WriteMetric(float value) (not in .Net Framework)
      • 公共事件EventHandlerEventCommandExecuted(在 .Net Framework 4.6.2 中,但不是 4.6.1)
      • public event EventHandler<EventCommandEventArgs> EventCommandExecuted (in .Net Framework 4.6.2, but not 4.6.1)
      • public int BufferSize { get;}(不在 .Net Framework 中)
      • public Stream UnderlyingStream { get;}(不在 .Net Framework 中)
      • public int BufferSize { get; } (not in .Net Framework)
      • public Stream UnderlyingStream { get; } (not in .Net Framework)

      System.Reflection.TypeInfo:以下所有 API 均不在 .Net Framework 中

      System.Reflection.TypeInfo: all the following APIs, none of which are in .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;}(不在 .Net Framework 中)
      • public static object GetData(string name)(不在 .Net Framework 中)
      • System.AppContext:
        • public static string TargetFrameworkName { get; } (not in .Net Framework)
        • public static object GetData(string name) (not in .Net Framework)
          • public static IEnumerable追加(这个IEnumerable源,TSource元素)(不在.Net Framework中)
          • public static IEnumerablePrepend(这个 IEnumerable 源,TSource 元素)(不在 .Net Framework 中)
          • public static IEnumerable<TSource> Append<TSource>(this IEnumerable<TSource> source, TSource element) (not in .Net Framework)
          • public static IEnumerable<TSource> Prepend<TSource>(this IEnumerable<TSource> source, TSource element) (not in .Net Framework)

          System.Security.Cryptography.ECCurve:整个 ECCurve 结构及其中的所有内容(包括 System.Security.Cryptography.ECCurve.NamedCurves 静态类)都不在 .Net Framework 中.换句话说,以下列表中的所有 API 都是 .Net Core 中的新 API,在 .Net Framework 4.6.1(或 4.6.2)中找不到:

          System.Security.Cryptography.ECCurve: entire ECCurve struct, and everything in it (including the System.Security.Cryptography.ECCurve.NamedCurves static class), are not in .Net Framework. In other words, all of the APIs in the following list are new in .Net Core and cannot be found in .Net Framework 4.6.1 (or 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结构:不在 .Net 框架中
        • System.Security.Cryptography.ECPoint结构:不在 .Net 框架中
        • System.Security.Cryptography.ECDsa:
          • public static ECDsa Create(ECCurve curve)(不在.Net框架中)
          • public static ECDsa Create(ECParameters parameters)(不在 .Net Framework 中)
          • public virtual ECParameters ExportExplicitParameters(bool includePrivateParameters)(不在 .Net Framework 中)
          • public virtual ECParameters ExportParameters(bool includePrivateParameters)(不在 .Net Framework 中)
          • public virtual void GenerateKey(ECCurve curve)(不在.Net框架中)
          • public virtual void ImportParameters(ECParameters parameters)(不在 .Net Framework 中)
          • System.Security.Cryptography.ECParameters struct: not in .Net Framework
          • System.Security.Cryptography.ECPoint struct: not in .Net Framework
          • System.Security.Cryptography.ECDsa:
            • public static ECDsa Create(ECCurve curve) (not in .Net Framework)
            • public static ECDsa Create(ECParameters parameters) (not in .Net Framework)
            • public virtual ECParameters ExportExplicitParameters(bool includePrivateParameters) (not in .Net Framework)
            • public virtual ECParameters ExportParameters(bool includePrivateParameters) (not in .Net Framework)
            • public virtual void GenerateKey(ECCurve curve) (not in .Net Framework)
            • public virtual void ImportParameters(ECParameters parameters) (not in .Net Framework)
              • protected IDictionary CapNames { get;放;}(不在 .Net Framework 中)
              • protected IDictionary Caps { get;放;}(不在 .Net Framework 中)
              • protected IDictionary CapNames { get; set; } (not in .Net Framework)
              • protected IDictionary Caps { get; set; } (not in .Net Framework)

              这远远超过 43 个 API.我还没有浏览过 .Net Standard 2.0 API 列表(它巨大);完成后,我将编辑此答案以反映我的发现.

              That's a lot more than 43 APIs. I haven't yet gone through the .Net Standard 2.0 API list (it's huge); once I do, I'll edit this answer to reflect what I find.

              这篇关于.Net Standard 2.0 中但 .Net Framework 4.6.1 中没有的 43 个 API 是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆