我正在努力寻找任何可以回答我以下问题的官方博客文章或文档:
非常感谢!
最佳答案
.NET Standard 是契约。由 .NET Core Mono 实现。 .NET 框架等
以 .NET Core 1.0 为例,as per the docs , 支持任何 .NET Standard 1.x 而 .NET Core 2.0, 支持 .NET Standard 2.0
If I have a netstandard2.0 library, can I have a dependency on a library which has only targeted netstandard1.x?
是 .较高版本的 .NET Standard 可以依赖较低版本。与较高版本的 net4x 或 netcoreapp 相同,可以依赖较低的版本。它们是 API 的 super 集。
If I have a library targeting netstandard2.0 which has a dependency on an ASP.NET Core 2.0.x package (e.g. Http.Abstractions) can I use this library from a netcoreapp2.1 application then?
是 .这是因为 Http.Abstractions 也针对 .NET Standard 而不是 .NET Core (netcoreapp)。这也是 ASP.NET Core 可以与完整框架一起使用的原因(经常引起混淆)。
Should/can a netstandard2.0 library have a dependency on a ASP.NET Core 2.1.x NuGet package?
否 . .NET Standard 不支持 .NET Core。因此,仅针对 .NET Standard 的库不能依赖于 .NET Core
关于asp.net-core - 不同版本的 netstandard 和 netcoreapp 如何兼容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51836260/