TFS 构建和清单文件:属性版本的值无效
TFS build and manifest file : the value of attribute version is invalid
我有一个 TFS 2012 版本(成功)生成了一个 WPF 客户端应用程序,其清单文件如下所示:
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<asmv1:assemblyIdentity name="MyApp.exe" version="1.0.70109.2" publicKeyToken="0000000000000000" language="fr" processorArchitecture="msil" type="win32" />
<!-- ... -->
</asmv1:assembly>
当我尝试启动应用程序时,出现此错误:
The application has failed to start because its side-by-side
configuration is incorrect...
在事件日志中,错误是:
Activation context generation failed for "C:\Dev\MyApp.exe.Manifest".
Error in manifest or policy file "C:\Dev\MyApp.exe.Manifest" on line
3. The value "1.0.70109.2" of attribute "version" in element "assemblyIdentity" is invalid.
到目前为止我能说的:
- 似乎版本号的每个部分都限制在 0-65535 之间:Application Manifests on MSDN。好的,很高兴知道。
- 我可以通过设置 1.0.1.2 来更改版本值,它 "fix" 问题(没有更多错误,应用程序启动)。
- 当我从 Visual Studio(调试和发布)构建它时,版本值始终为 1.1.0.0。
- 我还注意到该版本在 60000 左右,直到最近才跃升至 70000 左右。这可能是由于年份变化造成的:2016 -> 2017?!
我的问题是:
- TFS 构建是如何生成这个数字的?
- 如何更改?
FWIW,我最近也从 Visual Studio 2012 升级到 Visual Studio 2015。
从 Visual Studio 2012 升级到 Visual Studio 2015,第一步应该是在构建服务器上安装 Visual Studio 2015(或者 Microsoft Build Tools 2015)。在此之前,您的工作将受到当前本地构建基础逻辑与 MSBuild
TFS 工作流 activity 在服务器上执行的不同逻辑的不必要阻碍。然后检查您的生成定义的选定生成过程模板可能在 MSBuild 之外执行的版本控制逻辑,最后选择并实施适合您需要的版本控制方法。
我有一个 TFS 2012 版本(成功)生成了一个 WPF 客户端应用程序,其清单文件如下所示:
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<asmv1:assemblyIdentity name="MyApp.exe" version="1.0.70109.2" publicKeyToken="0000000000000000" language="fr" processorArchitecture="msil" type="win32" />
<!-- ... -->
</asmv1:assembly>
当我尝试启动应用程序时,出现此错误:
The application has failed to start because its side-by-side configuration is incorrect...
在事件日志中,错误是:
Activation context generation failed for "C:\Dev\MyApp.exe.Manifest". Error in manifest or policy file "C:\Dev\MyApp.exe.Manifest" on line 3. The value "1.0.70109.2" of attribute "version" in element "assemblyIdentity" is invalid.
到目前为止我能说的:
- 似乎版本号的每个部分都限制在 0-65535 之间:Application Manifests on MSDN。好的,很高兴知道。
- 我可以通过设置 1.0.1.2 来更改版本值,它 "fix" 问题(没有更多错误,应用程序启动)。
- 当我从 Visual Studio(调试和发布)构建它时,版本值始终为 1.1.0.0。
- 我还注意到该版本在 60000 左右,直到最近才跃升至 70000 左右。这可能是由于年份变化造成的:2016 -> 2017?!
我的问题是:
- TFS 构建是如何生成这个数字的?
- 如何更改?
FWIW,我最近也从 Visual Studio 2012 升级到 Visual Studio 2015。
从 Visual Studio 2012 升级到 Visual Studio 2015,第一步应该是在构建服务器上安装 Visual Studio 2015(或者 Microsoft Build Tools 2015)。在此之前,您的工作将受到当前本地构建基础逻辑与 MSBuild
TFS 工作流 activity 在服务器上执行的不同逻辑的不必要阻碍。然后检查您的生成定义的选定生成过程模板可能在 MSBuild 之外执行的版本控制逻辑,最后选择并实施适合您需要的版本控制方法。