nuget pack [someProject.csproj] 不会让我更改标题或描述 [英] nuget pack [someProject.csproj] won't let me change title or description

查看:40
本文介绍了nuget pack [someProject.csproj] 不会让我更改标题或描述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如果我在我的包中指定一个 nuspec(即 nuget pack someSpec.nuspec),我可以更改作者和描述,但我希望我的项目成为一个来源真相".不幸的是,我似乎无法通过命令行开关更改标题/描述/作者.我认为这会奏效:

I know I can change the author and the description if I specify a nuspec in my package (i.e. nuget pack someSpec.nuspec), but I want my project to the be the "one source of truth". Unfortunately, I can't seem to change the title/description/author via a command line switch. I figured this would work:

nuget pack Persistence.csproj -properties Title=Company.Project.Persistence -IncludeReferencedProjects -o bin\nuget_build 

但这不起作用.我可以通过命令行开关执行此操作吗?

but this doesn't work. Can I do this via command line switch?

推荐答案

经过多次浏览后,似乎改变它们的唯一方法是修改项目中 AssemblyInfo.cs 中的属性.单击此处查看 nuget codeplex 讨论

After much surfing, it would appear that the only way to change them is by modifying the attributes in AssemblyInfo.cs in your project. click here to see the nuget codeplex discussion

  • Title 映射到 [assembly: AssemblyTitle("Nuget.Package.Title")]
  • Version 映射到 [assembly: AssemblyVersion("1.0.0.0")]
  • Author 映射到 [assembly: AssemblyCompany("Microsoft")]
  • Description 映射到 [assembly: AssemblyDescription("")]
  • Title maps to [assembly: AssemblyTitle("Nuget.Package.Title")]
  • Version maps to [assembly: AssemblyVersion("1.0.0.0")]
  • Author maps to [assembly: AssemblyCompany("Microsoft")]
  • Description maps to [assembly: AssemblyDescription("")]

这似乎达到了我想要的效果.

This seems to have gotten me the desired effect.

此外,上面的链接说 Id 指向 AssemblyTitle,但从 Nuget 2.8 开始,Title 似乎指向 AssemblyTitleId 指向项目属性中程序集的名称.

Also, the above link says that Id points to AssemblyTitle, but as of Nuget 2.8, it would appear that Title points to AssemblyTitle and the Id points to the name of the assembly in the project properties.

这篇关于nuget pack [someProject.csproj] 不会让我更改标题或描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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