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

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

问题描述

更新:

所以现在似乎是一个

好的,除了 .NET 标准Github 自述页面也在说

<块引用>

另一方面,.NET Standard 2.0 添加了许多 .NET Framework 4.6.1 已经支持的 API.增量如下所示:

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

  • .NET Standard 2.0 只有 43 个 .NET Framework 4.6.1 不支持的 API最初,我们计划简单地从 .NET Standard 2.0 中删除这些 API,以便更容易地理解 .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 等其他框架中是否还有其他类似的情况?2.0 列中的 vNext 是什么意思?我是否应该担心其他框架中其他不受支持的 API,因为 考虑到 [Framework name] 不支持的 API 数量很少,而且这些都是采用率低的全新 API,我们认为这是一个更好的交易-关闭?

我能找到的最接近这个问题的答案是查看 NETStandard.Library NuGet 包 的依赖项.但是,这给了我 1.3 版本的依赖项(不是 1.6 或我真的不理解本节),并且没有给我应该已经确定的下一个 2.0 的 API 参考.

我们不能有一个完整记录的 API 列表真的支持每个 .NET Standard 版本吗?.NET Standard 的唯一目标是为开发人员提供这些非常重要的信息,为什么我找不到它?

解决方案

正如 Martin 在 中提到的那样他的评论.NET API 浏览器正是前阵子还在找.

您可以使用 .NET 标准 API 或任何框架实现进行选择和过滤,甚至可以选择任何版本.太好了,微软应该早点做出来的.

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天全站免登陆