[英]How to generate a non-.NET Core Library NuGet package within Visual Studio 2017
If I create a .NET Core Class Library in Visual Studio 2017, I get the Package tab on project properties. 如果在Visual Studio 2017中创建.NET Core类库,则会在项目属性上获得“包”选项卡。 If I create an "old fashioned" Class Library, I do not get the Package tab, nor the "Pack" target in MSBuild.
如果创建“老式”类库,则不会获得“程序包”选项卡,也不会在MSBuild中获得“程序包”目标。
NuGet is integrated into VS2017 and MSBuild to some degree, but it seems to be only for .NET Core projects. NuGet在某种程度上已集成到VS2017和MSBuild中,但似乎仅适用于.NET Core项目。
Is there a way to use any of the NuGet integration for non-.NET Core projects or do I just need to install the NuGet CLI and use a .nuspec file? 是否可以对非.NET Core项目使用任何NuGet集成,还是只需要安装NuGet CLI并使用.nuspec文件?
This support for integrated packaging needs "SDK-style" csproj files which are used for .NET Core and .NET Standard projects. 对集成包装的支持需要用于.NET Core和.NET Standard项目的“ SDK样式” csproj文件。 Since a few features (like some designers) aren't yet available for these projects, there are no templates for "SDK-style" csproj-based projects for .NET Standard.
由于这些项目尚无法使用某些功能(例如某些设计器),因此没有用于.NET Standard的基于“ SDK风格”,基于csproj的项目的模板。
However, you can create a .NET Standard project and change the csproj file from 但是,您可以创建一个.NET Standard项目,并从以下位置更改csproj文件:
<TargetFramework>netstandard1.6</TargetFramework>
to a net*
moniker like 成为
net*
绰号
<TargetFramework>net461</TargetFramework>
This gives you all the tooling for creating NuGet packages and managing versions and metadata. 这为您提供了用于创建NuGet软件包以及管理版本和元数据的所有工具。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.