简体   繁体   English

如何在Visual Studio 2017中生成非.NET Core库NuGet程序包

[英]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.

相关问题 如何从Visual Studio 2017 RC中的.NET Core MSBuild项目创建NuGet包? - How do you create a NuGet package from a .NET Core MSBuild project in Visual Studio 2017 RC? Visual Studio 2017和nuget包 - Visual studio 2017 and nuget package 如何在 Visual Studio 2017 为我创建的 NuGet 包中包含我的类库旁边的文本文件? - How do I include a text file alongside my class library in my NuGet package which Visual Studio 2017 is creating for me? 如何让Visual Studio 2017在类库项目中构建TypeScript(新的.net核心样式.csproj) - How to get Visual Studio 2017 to compile TypeScript on build in class library project (new .net core style .csproj) 不使用Visual Studio构建类库(包)NuGet包项目 - Build Class Library (Package) NuGet Package Projects Without Visual Studio .NET Core 2.1:如何在Visual Studio 2017中进行调试期间触发在项目文件中定义的复制任务? - .NET Core 2.1 : How to trigger Copy task defined in the project file during debugging in the Visual Studio 2017? 在 Visual Studio 2017 中通过 postbuild 事件构建 .net 核心项目 - Build .net core project by postbuild event in visual studio 2017 如何使用 BuildManager 在 Visual Studio 2017 (MsBuild 15) 上构建 .Net Core 项目或解决方案 - How to use BuildManager to build .Net Core project or solution on Visual Studio 2017 (MsBuild 15) 如何设置Visual Studio来构建NuGet包? - How do I set Visual Studio to build a NuGet package? 如何更改 Visual Studio 项目中的 NuGet 包引用以使用 Nuget.config - How to change the NuGet-package reference in a Visual Studio project to use Nuget.config
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM