如何创建和安装两个不同版本的WPF ClickOnce应用程序? [英] How can I create and install two different versions of a WPF ClickOnce application?

查看:86
本文介绍了如何创建和安装两个不同版本的WPF ClickOnce应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个随ClickOnce一起发布的WPF应用程序。目前的设置是我们有两个不同的版本,基于两个不同的部署站点中的两个不同的配置(它们连接到不同的数据库)。它们可以独立于每个
其他方式正常工作,但它们不能同时安装在计算机上。有没有办法解决这个问题,以便当你试图安装它们时这两个版本不会相互冲突?



如果有帮助,我已经预先构建事件在不同的配置文件中设置交换,该文件将根据当前配置使用。



Visual Studio支持发布配置文件对于Web应用程序,但WPF项目完全不存在。

解决方案


As据我所知,部署URL是应用程序身份的一部分。如果在启动时从一个位置安装它,则需要从同一位置安装更新。即使您没有在清单
中指定部署提供程序,它也会执行此操作 - 它只是将其设置为您首次安装它的位置。


我知道的唯一解决方法是将应用程序作为在线应用程序发布到网络服务器。


如果要发布多个版本的ClickOnce项目,您必须更改程序集名称和产品名称,有关详细信息,请参阅以下博客:


ClickOnce:并发版本


问候,


Frankie


注意:此响应包含对第三方万维网站点的引用。 Microsoft提供此信息是为了方便您。 Microsoft不控制这些网站,也未测试在这些网站上找到的任何软件或信息;因此,
Microsoft不能就其中发现的任何软件或信息的质量,安全性或适用性做出任何陈述。使用互联网上的任何软件都存在固有的危险,微软提醒您在从互联网上检索任何软件之前确保您完全了解风险。


I have a WPF application distributed with ClickOnce. The current setup is that we have two different versions based on two different Configurations in two different deployment sites (they connect to different databases). They work fine independently of each other, but they can't both be installed on a computer at the same time. Is there any way to fix this so that the two versions don't conflict with each other when you try to install them both?

If it helps, I already have pre-build events set up swap in a different config file that is to be used based on the current Configuration.

Visual Studio has support for Publish Profiles for web applications, but is completely absent for WPF projects.

解决方案

Hi,

As far as I know, the deployment URL is part of the identity of the application. If you install it from one location when it starts, you need to install updates from the same location. It does this even if you don't specify a deployment provider in the manifest -- it just sets it to the place you first install it from.

The only way around this that I know of is to publish the application to a webserver as an online-only application.

If you want to publish multiple version for the ClickOnce project, you have to change the assembly name and the product name, please refer to the following blog for more details:

ClickOnce: Concurrent versions

Regards,

Frankie

Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


这篇关于如何创建和安装两个不同版本的WPF ClickOnce应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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