问题描述
嗨
我们正在使用MSBuild作为我们夜间构建和测试的一部分,但遇到了一个与已发布的ClickOnce应用程序的版本控制有关的奇怪问题.
We are using MSBuild as part of our nightly build and test, but have run into a somewhat strange issue relating to the versioning of a published ClickOnce application.
我们的每晚构建使用msbuild首先编译我们所有的解决方案,并在随后的步骤中使用另一个对msbuild的调用来发布ClickOnce应用程序.在第二个调用中,我们(通过命令行)指定ApplicationVersion属性,以使已发布的应用程序具有总体内部编号.在我们第一次调用msbuild时,未设置ApplicationVersion属性,因为它们只需要编译解决方案,并且不进行任何发布.
Our nightly build uses msbuild to first compile all our solutions and in a later step also publish our ClickOnce application using another call to msbuild. In this second call we specify (by commandline) the ApplicationVersion property in order to have the published app attributed with the overall buildnumber. This ApplicationVersion property is NOT set during our first calls to msbuild, since they only need to compile the solutions and does not do any publishing.
奇怪的是,在我们的第二次调用中,ApplicationVersion属性被忽略了,就像生成的.application文件在其assemblyidentity标签中保留默认1.0.0.0一样!!!但是publish调用确实在进程中创建了一个正确命名的文件夹([AppName] _1_0_565_0),因此我非常确信msbuild调用的语法正确.
The strange thing is that the ApplicationVersion property is ignored in our second call in as much as the .application file generated holds a default 1.0.0.0 in its assemblyidentity tag!?! The publish call does however make a correctly named folder in the process ( [AppName]_1_0_565_0) so I'm pretty convinced that the msbuild call is correctly syntaxed.
稍作尝试和调试后,似乎我们的第二个调用不会重建文件(因为未检测到更改),而只是复制已经存在的文件.如果不需要重新编译,这是否意味着在.application文件的生成中将忽略ApplicationVersion?这是设计使然还是我在这里遗漏了什么?
After trying and debugging a bit it seems that our second call does not rebuild the files (since no changes are detected) and just copies the already existing files. Does this mean that the ApplicationVersion is ignored in the generation of the .application file if no recompilation is needed? Is this by design or am I missing something here?
如果这是预期的行为,那么您建议什么?有没有一种方法可以在我的第二个调用上强制重新编译,还是应该将ApplicationVersion属性附加到第一个调用上,以确保已编译文件已准备好"?为以后的发布调用?
If this is the expected behaviour, what do you recommend? Is there a way to force recompilation on my second call or should I append the ApplicationVersion property to the first call to ensure that the compiled files are "prepared" for the later publish call?
致谢
推荐答案
仅仅是您还应该设置应用程序的发布版本吗?应用程序版本和发布版本不是同一回事...
could it be just that you should also set application's Publish Version? Application version and Publish version are not the same thing...
Andrej
这篇关于在ClickOnce发布时,ApplicationVersion被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!