C#部署我的应用程序 - 从ClickOnce的唯一网站 [英] C# Deploying my application - clickonce from web only

查看:159
本文介绍了C#部署我的应用程序 - 从ClickOnce的唯一网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我已经开发了我的C#应用​​程序。我已经准备好部署。我想要让这个用户总是从我的网站启动它(这样他们总能得到更新,无需安装,等等)。

So I have developed my application in C#. I am ready to deploy it. I want to make it so that users always launch it from my website (so that they always get updates, no install, etc.).

时的ClickOnce的正确方法做这个?

Is ClickOnce the proper way to do this?

我试过部署的ClickOnce到我的服务器和几件事情在我跳出:

I tried deploying ClickOnce to my server and a few things jump out at me:

1)用户是给运行安装或启动。应用文件的选项 - 有什么区别?不能把它在它自己的检测呢?

1) The user is given the option to run a setup or launch the .application file - what's the difference? Can't it detect this on it's own?

2)当我尝试推出它要求将其下载到我的电脑。应用。 ?反正只是直接从浏览器中启动文件

2) When I try to "launch" the .application it asks to download it to my computer. Anyway to just launch the file straight from the browser?

3)我下载并运行。应用文件后,我得到以下消息的错误:部署和应用没有匹配的安全区域。

3) After I download and run the .application file I get an error with the following message: "Deployment and application do not have matching security zones."

推荐答案

是,ClickOnce的满足您的需求完美。

Yes, ClickOnce suits your needs perfectly.


  1. 的setup.exe ,或引导程序,因为它叫,是用来安装的先决条件,如.NET Framework和Microsoft安装程序,因为它是.NET框架包含的ClickOnce运行,这是安装应用程序所需。引导程序需要进行一次,只有在没有先决条件的计算机上使用,之后只在。应用文件,名为部署清单,用于更新。当您发布使用ClickOnce,创建一个 Publish.htm 文件,其中包含检测,如果用户已经安装的先决条件一些JavaScript代码。如果用户没有,它提出了一个按钮链接到的setup.exe ,否则出现一个按钮,它直接链接到。应用文件。您可以使用页面(或创建一个基于它),给您的用户在最短的安装体验。

  1. The setup.exe, or "bootstrapper" as it's called, is used to install prerequisites such as the .NET Framework and Microsoft Installer, since it is the .NET framework that contains the ClickOnce runtime, which is needed to install your application. The bootstrapper needs to be used only once and only on computers that don't have those prerequisites, after that only the .application file, called the "deployment manifest", is used for updates. When you publish using ClickOnce, a Publish.htm file is created, which contains some JavaScript code that detects if the user has the prerequisites installed. If the user doesn't, it presents a button that links to setup.exe, otherwise it present a button which links directly to the .application file. You can use that page (or create one based on it) to give the shortest possible installation experience for your users.

要么没有安装.NET Framework在客户端计算机上(在这种情况下,使用引导程序),或您的Web服务器配置不正确,因此不会在。应用扩展与MIME类型相关联应用程序/ x-MS-应用。创建一个协会解决问题。我还建议加入一些HTTP标头禁用部署清单缓存,否则用户的浏览器高速缓存,并可能导致用户丢失的更新。

Either the .NET Framework is not installed on the client's computer (in this case, use the bootstrapper), or your web server is not configured properly, and so does not associate the .application extension with the MIME type of application/x-ms-application. Create that association to solve the issue. I also recommend adding some http headers to disable the cache on the deployment manifest, otherwise the user's browser can cache it and it could lead to the user missing updates.

您无法下载并在本地运行部署清单文件被发布到Web位置的ClickOnce安装,因为ClickOnce的给出了一个更高的信任级别本地安装(如从本地计算机或网络共享),但应用程序清单指向网络,其具有较低的信任水平,因而未能在安装源。一旦你解决问题2,这个问题也将得到解决。

You cannot download and run the deployment manifest file locally for a ClickOnce installation that was published to a web location, since ClickOnce gives a higher trust level to local installation (such as from the local computer or a network share), but the application manifest points to an installation source on the web, which has a lower trust level, and thus fails. Once you solve issue 2, this issue will also be resolved.

这篇关于C#部署我的应用程序 - 从ClickOnce的唯一网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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