首页 > 解决方案 > nuget 打包程序集时,nuspec 文件中的 $version$ 令牌未从 AssemblyInfo.cs 读取

问题描述

单独运行“nuget pack”时,它似乎会读取 csproj 文件并使用“版本”,我想自动增加构建版本号。

运行“nuget pack nuspec.nuspec”时,它会读取 nuspec 文件,但会产生此错误:“尝试解析清单文件中属性 'version' 的值 '' 时发生错误”

问题:如何自动增加 nuget 包的版本值?我已经设法自动增加程序集信息版本,但我无法让 nuget 从文件中读取。我只需要一个基本的 nuget 包构建版本增量。主要版本之类的东西可以手动更改。

我正在使用 .net 框架和 nuget.exe。版本 5.8.1.7021

标签: .netvisual-studionuget

解决方案


Actually, this is an issue on the latest recommended nuget.exe v5.8.1. I have tested it several times and all failed. Also, nuget.exe v5.7.0 has the same issue.

Solution

So I suggest you could try to use nuget.exe v5.6.0. It works well without any issues.

Besides, I have reported the issue on our DC Forum. You can vote it and add any comments if I did not describe it in detail. Please track this ticket.


推荐阅读