简体   繁体   English

当 nuget 打包程序集时,nuspec 文件中的 $version$ 令牌未从 AssemblyInfo.cs 读取

[英]$version$ token in nuspec file not reading from AssemblyInfo.cs when nuget packaging an assembly

When running "nuget pack" alone, it seems to read the csproj file and use "Version" which I would like to auto increment the build version number.单独运行“nuget pack”时,它似乎会读取 csproj 文件并使用“版本”,我想自动增加构建版本号。

When running "nuget pack nuspec.nuspec" it reads the nuspec file but produces this error: "an error occurred while trying to parse the value '' of property 'version' in the manifest file"运行“nuget pack nuspec.nuspec”时,它会读取 nuspec 文件,但会产生此错误:“尝试解析清单文件中属性 'version' 的值 '' 时发生错误”

Question: how do I auto increment the version value for the nuget package?问题:如何自动增加 nuget package 的版本值? I have managed to auto increment the assembly info version but I am unable to get nuget to read from the file.我已经设法自动增加程序集信息版本,但我无法让 nuget 从文件中读取。 I just need a basic nuget package build version increment.我只需要一个基本的 nuget package 构建版本增量。 And things like Major versions can be changed manually.主要版本之类的东西可以手动更改。

I am using .net framework and nuget.exe.我正在使用 .net 框架和 nuget.exe。 version 5.8.1.7021版本 5.8.1.7021

Actually , this is an issue on the latest recommended nuget.exe v5.8.1 .实际上,这是最新推荐的nuget.exe v5.8.1上的问题。 I have tested it several times and all failed.我已经测试了好几次,都失败了。 Also, nuget.exe v5.7.0 has the same issue.此外, nuget.exe v5.7.0也有同样的问题。

Solution解决方案

So I suggest you could try to use nuget.exe v5.6.0 .所以我建议你可以尝试使用nuget.exe v5.6.0 It works well without any issues.它运行良好,没有任何问题。

Besides , I have reported the issue on our DC Forum .此外,我已经在我们的 DC 论坛上报告了这个问题 You can vote it and add any comments if I did not describe it in detail.如果我没有详细描述,您可以投票并添加任何评论。 Please track this ticket.请追踪这张票。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM