使用ASP.NET 5类库指定NuGet元数据

本文关键字:NuGet 元数据 类库 ASP NET 使用 | 更新日期: 2023-09-27 17:59:05

ASP.NET 5类库项目的输出是一个Nuget包(.nupkg)。我的Project.json文件如下所示:

{
  "version": "1.0.0-*",
  "description": "Provides boilerplate framework code for an ASP.NET MVC project. ASP.NET MVC Boilerplate is a professional template for building secure, fast, robust and adaptable web applications or sites. It provides the minimum amount of code required on top of the default MVC template provided by Microsoft. You can download the ASP.NET MVC Boilerplate project template on the Visual Studio Gallery or download the code on GitHub.",
  "authors": [ "Muhammad Rehan Saeed" ],
  "tags": [ "ASP.NET MVC MVC6 Boilerplate Muhammad Rehan Saeed Framework" ],
  "projectUrl": "https://github.com/RehanSaeed/ASP.NET-MVC-Boilerplate",
  "licenseUrl": "https://github.com/RehanSaeed/ASP.NET-MVC-Boilerplate/blob/master/LICENSE"
  ...omitted
}

似乎没有标题、图标URL、摘要或发行说明、版权或语言的属性。如何设置这些?

使用ASP.NET 5类库指定NuGet元数据

它们可以像设置任何其他属性一样进行设置。以下是支持的内容:https://github.com/aspnet/dnx/blob/dev/src/Microsoft.Framework.Runtime/Project.cs#L223-L238

对于您的特殊情况:

Title -> "title"
IconURL -> "iconUrl"
Summary -> "summary"
Release Notes -> "releaseNotes"
Copyright -> "copyright"
Language -> "language"