[英].NET Standard 2.0 NuGet Package Generation
I am working with my .NET class library project that targets Multiple .NET frameworks and now after having downloaded the .NET Core 2.0 SDK in my Windows 10 machine I am trying to target .NET Standard 2.0
as well. 我正在使用面向多个.NET框架的.NET类库项目,现在在我的Windows 10机器中下载了.NET Core 2.0 SDK后 ,我也试图以
.NET Standard 2.0
为目标。
<TargetFrameworks>net45;net46;netstandard1.0;netstandard1.3;netstandard2.0</TargetFrameworks>
The problem is that when the NuGet package generated by Visual Studio (2017) after compilation is opened via NuGet Package Explorer it shows that for .NET Standard 2.0
there are no dependencies. 问题是当编译后由Visual Studio(2017)生成的NuGet包通过NuGet Package Explorer打开时,它表明对于
.NET Standard 2.0
没有依赖性。
Shouldn't it be having NETStandard.Library 2.0.0 as a dependency? 它应该不是NETStandard.Library 2.0.0作为依赖?
If so is it necessary (at-least till an update is released for VS) that a dependency is explicitly specified in the NuGet package for NETStandard.Library 2.0.0 ? 如果有必要(至少在VS发布更新之前),在NuSet包中为NETStandard.Library 2.0.0明确指定了依赖关系?
To be certain that it wasn't an isolated case with my project I created another project and added Newtonsoft.Json as a dependency. 为了确保它与我的项目不是一个孤立的案例,我创建了另一个项目并添加了Newtonsoft.Json作为依赖项。 The result was still the same.
结果仍然相同。
The default NETStandard.Library
version is still 1.6.1
when publishing for .NET Standard versions lower than 2.0. 发布低于2.0的.NET Standard版本时,默认的
NETStandard.Library
版本仍为1.6.1
。 While the 2.0.0
version is technically the same (it has the same list of dependencies for the older .NET Standard versions), you risk creating downgrade warnings for consuming projects that reference version 1.6.1
. 虽然
2.0.0
版本在技术上是相同的(它具有相同的旧.NET标准版本的依赖项列表),但您可能会冒险为使用引用版本1.6.1
项目创建降级警告。
For .NET Standard versions 2.0 and higher, no dependency on NETStandard.Library
is needed so your library will show "No Dependencies" as long as you don't add any additional NuGet packages. 对于.NET Standard 2.0及更高版本,不需要依赖
NETStandard.Library
,因此只要您不添加任何其他NuGet包,您的库就会显示“No Dependencies”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.