如何同时部署两个ClickOnce版本? [英] How do I deploy two ClickOnce versions simultaneously?

查看:245
本文介绍了如何同时部署两个ClickOnce版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够为我的应用程序安装测试ClickOnce服务器,用户可以并行运行生产版本和测试版本。这是可能吗?



我首先尝试在 AssemblyInfo.cs 中使用以下内容,还可以更改ClickOnce中的名称部署尽管所有这些都是用测试版本覆盖用户的生产版本。同样,当他们返回到生产服务器时也是一样的。

  #if DEBUG 
[assembly:AssemblyTitle (产品名称 - 测试)]
#else
[assembly:AssemblyTitle(Product Name)]
#endif

我以为我也应该澄清两个部署位置在不同的服务器上是不同的。



更新



我还尝试根据调试模式设置清单的GUID,但再次无效(虚拟GUID的

  #if DEBUG 
[assembly:Guid(AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA )]
#else
[assembly:Guid(BBBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB)]
#endif
pre>

两个区别如何?看来安装程序将它们视为两个单独的程序,因为我得到每个安装的确认。虽然,当我安装第二个,添加/删除程序只看到后者,虽然前者仍然在磁盘上,因为我稍后重新安装,它只是运行,但是然后添加/删除程序切换

解决方案

这可能听起来有点跛脚,但最简单的方法是有两个EXE您的解决方案中的项目。每个这些的 Main 方法将只调用原始EXE项目中的 Main 方法(您将拥有刚刚切换成为一个DLL文件)



这意味着每个EXE项目都可以有自己的ClickOnce发布设置,以及自己的 app.config 文件。这意味着您有不同的生产和测试版本的连接字符串。



您的其他选项(似乎最有意义的选项)是使用 MageUI.exe 手动构建ClickOnce文件,这将您可以在每次运行该工具时选择不同的配置文件和发布位置。还有一个命令行版本(Mage.exe),所以你可以理论上自动化这个。



然而,我们发现两个跑步项目的解决方案远远简单。我建议你先尝试一下。


I would like the ability to have a test ClickOnce server for my applications where users can run both the production version and the test version in parallel. Is this possible?

I first tried using the following in AssemblyInfo.cs and also changing the name in the ClickOnce deployment though all this achieved was overwriting the users' production version with the test version. Likewise, it did the same when they went back to the production server.

#if DEBUG
[assembly: AssemblyTitle("Product Name - Test")]
#else
[assembly: AssemblyTitle("Product Name")]
#endif

I thought I should also clarify that the two deployment locations are different from one another and on different servers.

UPDATE

I've also tried setting the GUID for the manifest depending on the debug mode, but again it does not work (dummy GUID's used below).

#if DEBUG
[assembly: Guid("AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA")]
#else
[assembly: Guid("BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB")]
#endif

How are the two distinguished? It seems that the installer sees them as two separate programs as I get a confirmation of installation for each. Though, when I install the second one, "Add/Remove Programs" only sees the latter, though the former is still on disk, as when I go to reinstall it later, it just simply runs, but then the add/remove programs switches back to the former name.

解决方案

It might sound kind of lame, but the easiest way to do this is to have two EXE projects in your solution. The Main method of each of these will just call the Main method in your original EXE project (which you'll have just switched over to being a DLL file).

This means that each EXE project can have its own ClickOnce publishing settings, as well as its own app.config file. This means you have different connection strings for the production and the test version.

Your other option (the one that might seem to make the most sense) is to use MageUI.exe to manually build the ClickOnce files, which would let you choose a different configuration file and publish location each time you ran the tool. There's also a command line version (Mage.exe) so you could in theory automate this.

However, we found that the solution with two "runner" projects was far far simpler. I'd recommend you try that first.

这篇关于如何同时部署两个ClickOnce版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆