NetStandard.Library NuGet包和项目属性中的Target Framework有什么关系?
What is the relationship between the NetStandard.Library NuGet package and the Target Framework in project properties?
我有一个 .NET Standard class 库项目。我希望该库可供最广泛的消费应用程序使用,因此按照 Microsoft 的建议 here,我在我的项目属性中以 .NET Standard 1.3 为目标。
但是,还有一个名为 NetStandard.Library
的 NuGet 包。在这条线上的某个地方,我的项目也参考了这一点。更重要的是,它是一个不同的版本(1.6)。我很困惑。这样可以吗?
它们之间有什么关系?
And somewhere along the line, my project got a reference to this as
well. What's more, it's a different version (1.6). I'm confused. Is
this okay? What is the relationship between these?
我认为您不必为此担心太多。
1.6.1
只是NetStandard.Library
nuget包的版本,与目标平台的版本无关,互不干扰。
NetStandard.Library
nuget 包只是为相关的网络标准项目提供服务,并提供任何库和 api 来开发、构建、调试当前项目。
Besdies,NetStandard.Library 1.6.1
服务网标准 1.x 项目,而 NetStandard.Library 2.0.3
服务网标准 2.x 项目。
所以当你完成开发并将你的 net standard 1.3 lib 项目打包为 nuget 包然后在目标平台上使用它时,实际上,NetStandard.Library
nuget 包已经完成了它的工作并且与这一步无关.
当将此类网标项目用于其他目标平台项目时,只需考虑网标版本与目标平台版本是否在支持范围内如您的链接文档所述。
------------更新1------------
实际上,当然。1.6.1
版本只是nuget包版本。 NetStandard.Library 1.6.1
nuget 包定义了一个或多个 standard.net 版本库。
据我所知,1.6.1
版本支持 net standard 1.0~1.6 class 库项目和这些 net standard 的 nuget 包服务版本。
然后它将当前项目指向对应的目标平台项目。
希望对您有所帮助。
我有一个 .NET Standard class 库项目。我希望该库可供最广泛的消费应用程序使用,因此按照 Microsoft 的建议 here,我在我的项目属性中以 .NET Standard 1.3 为目标。
但是,还有一个名为 NetStandard.Library
的 NuGet 包。在这条线上的某个地方,我的项目也参考了这一点。更重要的是,它是一个不同的版本(1.6)。我很困惑。这样可以吗?
它们之间有什么关系?
And somewhere along the line, my project got a reference to this as well. What's more, it's a different version (1.6). I'm confused. Is this okay? What is the relationship between these?
我认为您不必为此担心太多。
1.6.1
只是NetStandard.Library
nuget包的版本,与目标平台的版本无关,互不干扰。
NetStandard.Library
nuget 包只是为相关的网络标准项目提供服务,并提供任何库和 api 来开发、构建、调试当前项目。
Besdies,NetStandard.Library 1.6.1
服务网标准 1.x 项目,而 NetStandard.Library 2.0.3
服务网标准 2.x 项目。
所以当你完成开发并将你的 net standard 1.3 lib 项目打包为 nuget 包然后在目标平台上使用它时,实际上,NetStandard.Library
nuget 包已经完成了它的工作并且与这一步无关.
当将此类网标项目用于其他目标平台项目时,只需考虑网标版本与目标平台版本是否在支持范围内如您的链接文档所述。
------------更新1------------
实际上,当然。1.6.1
版本只是nuget包版本。 NetStandard.Library 1.6.1
nuget 包定义了一个或多个 standard.net 版本库。
据我所知,1.6.1
版本支持 net standard 1.0~1.6 class 库项目和这些 net standard 的 nuget 包服务版本。
然后它将当前项目指向对应的目标平台项目。
希望对您有所帮助。