.NET标准API参考 [英] .NET Standard API Reference

查看:101
本文介绍了.NET标准API参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:



所以它似乎是



好的,除了。NET Standard Github自述页面也说


.NET Standard 2.0添加了.NET Framework 4.6.1已经支持的许多API。增量看起来如下:




  • .NET Standard 2.0添加了.NET Framework 4.6.1已经支持的14,994个API

    >

  • .NET Standard 2.0仅包含43种.NET Framework 4.6.1不支持的API。最初,我们计划简单地淘汰这些API从.NET Standard 2.0中获取,以便更轻松地了解在.NET Framework 4.6.1上将运行什么。




但是,我们对此有很多反馈。您告诉我们,此决定使您很难推理.NET Standard版本控制规则。因此,我们决定简化此过程。




  • .NET Standard 2.0将是.NET Standard 1.6的严格超集。换句话说,.NET Standard 2.0和1.x之间不会发生重大变化。


  • .NET Framework 4.6.1将允许引用已编译的二进制文件.NET Standard 2.0。
    考虑到.NET Framework 4.6.1不支持的API的数量很少,而且这些都是采用率较低的全新API,我们认为这是一个更好的折衷方案。




您可以使用API​​端口扫描给定的应用程序,以确保应用程序中没有代码依赖于这些API。


那又怎样?他们解决此问题的方法是扫描给定的应用程序?因此,如果我开始一个新项目,并给出一个事实,那就是我还没有编写代码,我将以.NET Standard为目标,并祈祷我不会以不支持的API告终?



此外,在其他框架(如Xamarin或UWP)中是否还有其他类似情况? vNext 到底在2.0列中是什么意思?我是否应该担心其他框架中其他不受支持的API,因为考虑到[框架名称]不支持的API的数量很少,而且这些都是采用率较低的全新API,我们认为这是一个更好的折衷方案?



我可以通过查看 NETStandard.Library NuGet包的依赖项。但是,这给了我1.3版的依赖关系(不是1.6版,或者我不是很了解本节),也没有给我提供应该确定的下一个2.0版的API参考。



我们不能为每个.NET Standard版本提供真的完整的API完整列表吗? .NET Standard的唯一目标是向开发人员提供非常重要的信息,所以为什么找不到呢?

解决方案

正如马丁在他的评论中提到的那样,。NET API浏览器正是我前一阵子所寻找的。



您可以使用.NET标准API或任何Framework实现进行选择和过滤,甚至可以选择任何版本。完美,微软应该早点做到这一点。


UPDATE:

So it seems to be an open issue now. So I guess until this is done I will have to rely on .NET Core API reference and pray I won't hit one of the 43 APIs that .NET Framework 4.6.1 doesn't support but are officially supposed to be...

Also relying on .NET Core API reference and considering the same as .NET standard could be badly surprising. For example when I take a look at the namespace list I can see System.Drawing but when clicking on it, we then realize this is an almost empty namespace containing only 6 structures.

Are there several namespaces like this? I don't know, I have to compare .NET core and .NET Framework documentation to get the answer.

ORIGINAL POST:

I'm trying to find the .NET Standard API reference.

On this page there are only links to .NET Core API reference and .NET Framework API reference.

Yes I've searched and I've read others SO questions. For example this answer points to .NET Core API reference instead of .NET standard and the same in this Github issue feed

But .NET Core and .NET Standard are different. .NET Core is the implementation of .NET Standard APIs.

One of the big problem I see here is for example based on the official documentation .NET Framework 4.6.1 will implement .NET Standard 2.0

Ok great, except that the .NET Standard Github readme page is also saying

On the other hand, .NET Standard 2.0 adds many APIs that .NET Framework 4.6.1 already supports. The delta looks as follows:

  • .NET Standard 2.0 adds 14,994 APIs that .NET Framework 4.6.1 already supports

  • .NET Standard 2.0 only has 43 APIs that .NET Framework 4.6.1 doesn't support Originally, we planned to simply elide those APIs from .NET Standard 2.0 in order to make it easier to understand what will work on .NET Framework 4.6.1.

However, we got a lot of feedback around this. You told us that this decision makes it really hard to reason about .NET Standard versioning rules. Thus, we decided to simplify this:

  • .NET Standard 2.0 will be a strict superset of .NET Standard 1.6. In other words, no breaking changes will happen between .NET Standard 2.0 and 1.x.

  • .NET Framework 4.6.1 will allow referencing binaries that are compiled against .NET Standard 2.0. Considering the number of APIs that .NET Framework 4.6.1 will not support is low and that these are all brand-new APIs with low adoption we believe this is a much better trade-off.

You can use API Port to scan a given application to make sure no code in your application depends on these APIs.

So what? Their solution to this problem is to scan a given application? So if I start a new project, giving the fact that I don't have code written yet, I would target .NET Standard and pray I don't end up with unsupported APIs that are supposed to be?

Also, are there other cases like this in other frameworks like Xamarin or UWP? What does that mean vNext exactly in the 2.0 column? Should I be worried of other unsupported APIs in other frameworks because Considering the number of APIs that [Framework name] will not support is low and that these are all brand-new APIs with low adoption we believe this is a much better trade-off?

The closest answer I can find to this question is by looking at the NETStandard.Library NuGet package's dependencies. However that gives me dependencies of the 1.3 version (not 1.6 or I don't really understand this section), and that doesn't give me APIs reference of the next 2.0 which are supposed to be already determined.

Can't we have a full documented list of APIs really supported for each .NET Standard version? The only goal of .NET Standard is to provide developers this very important information, so why can't I find it?

解决方案

As Martin mentioned it in his comment, the .NET API Browser is exactly what I was looking for a while ago.

You can select and filter with the .NET standard API or any Framework implementation and even select any version. That's perfect, Microsoft should have made this earlier.

这篇关于.NET标准API参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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