使用 NuGet Pack 时是否可以在没有 nuspec 文件的情况下指定包名称? [英] When using NuGet Pack is it possible to specify the package name without a nuspec file?

查看:62
本文介绍了使用 NuGet Pack 时是否可以在没有 nuspec 文件的情况下指定包名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为 .csproj 文件创建 nuget 包,但希望包名称与 csroj 文件(默认情况下)不同,并且我不想指定 .nuspec 文件.有没有办法做到这一点?我只能在命令行选项上看到版本名称覆盖选项,而看不到包名称覆盖选项.

I am trying to create a nuget package for a .csproj file but want the package name to be different from the csroj file (which it is by default) and I don't want to specify a .nuspec file. Is there a way of doing this? I can only see a version name override option on the command line options and not a package name override option.

我正在 TeamCity 中执行此操作,但这不是重点.我想我需要向 NuGet 包命令传递额外的参数?

I am doing this in TeamCity but this is besides the point. I am thinking I need to pass additional parameters to the NuGet pack command?

谢谢,

推荐答案

Nuget 命令行不提供任何直接更改名称的选项.http://docs.nuget.org/docs/reference/command-line-reference#Pack_Command

Nuget command line doesn't provide any option for direct name change. http://docs.nuget.org/docs/reference/command-line-reference#Pack_Command

如果您想要不同的项目和 nuget 包名称,您必须准备和编辑自定义 nuspec 文件.您也可以在使用例如创建包后手动执行此操作NuGetPackage 资源管理器.

If you want to differ project and nuget package name you will have to prepare and edit custom nuspec file. You may also do it manually after creating package by using e.g. NuGetPackage Explorer.

这篇关于使用 NuGet Pack 时是否可以在没有 nuspec 文件的情况下指定包名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆