简体   繁体   English

Nuget 不再识别 assemblyinfo.cs 版本

[英]Nuget does not recognize assemblyinfo.cs version any longer

We have a DLL which we pack into a nuget package.我们有一个 DLL,我们将其打包到 nuget package 中。 The DLL's assemblyinfo.cs includes this entries: DLL 的 assemblyinfo.cs 包括以下条目:

[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")]

After using following nuget command:使用以下 nuget 命令后:

nuget pack dllproject.csproj -Symbols

we get a nuget package named as this:我们得到一个 nuget package 命名为:

dllproject.1.0.1215.16457.nupkg

This works on the machines of my coleagues and mine, furthermore on our build machine.这适用于我的同事和我的机器,此外还适用于我们的构建机器。

Now we had to switch to a new build machine.现在我们不得不切换到新的构建机器。 After setting up the system the nuget command everytime leads to following result:设置系统后,每次使用 nuget 命令都会导致以下结果:

dllproject.1.0.0.nupkg

It seems that something is missing and so autoincrement of the version does not work any more.似乎缺少某些东西,因此版本的自动增量不再起作用。

Have someone an idea what can i do that this will work again?有人知道我该怎么做才能再次起作用吗?

EDIT: I found out that this only does not work in virtualized environments like Virtual machine or Proxmox/KVM.编辑:我发现这仅在虚拟机或 Proxmox/KVM 等虚拟化环境中不起作用。 Does anybody knows why?有人知道为什么吗?

Root cause for the problem was a bug in nuget.exe 5.9.1 After setting verbosity to detailed i can see an error while trying to read assembly infos.问题的根本原因是 nuget.exe 5.9.1 中的错误 将详细程度设置为详细后,我在尝试读取程序集信息时看到错误。 Using an older version of nuget.exe like 4.7.3 solved the problem.使用像 4.7.3 这样的旧版本 nuget.exe 解决了这个问题。 Everything works as expected.一切都按预期工作。

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

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