ClickOnce应用程序错误:部署和应用程序没有匹配的安全区域

问题描述 投票:14回答:5

我在使用FireFox和Chrome浏览器的ClickOnce应用程序上遇到了麻烦它运行正常。例外的细节是:

PLATFORM VERSION INFO
    Windows             : 6.1.7600.0 (Win32NT)
    Common Language Runtime     : 4.0.30319.239
    System.Deployment.dll       : 4.0.30319.1 (RTMRel.030319-0100)
    clr.dll             : 4.0.30319.239 (RTMGDR.030319-2300)
    dfdll.dll           : 4.0.30319.1 (RTMRel.030319-0100)
    dfshim.dll          : 4.0.31106.0 (Main.031106-0000)

SOURCES
    Deployment url          : file:///C:/Users/ibz/Downloads/MyApp.application

IDENTITIES
    Deployment Identity     : MyApp.application, Version=1.0.1.23, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil

APPLICATION SUMMARY
    * Online only application.
    * Trust url parameter is set.
ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of C:\Users\ibz\Downloads\MyApp.application resulted in exception. Following failure messages were detected:
        + Deployment and application do not have matching security zones.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
    No transaction error was detected.

WARNINGS
    * The manifest for this application does not have a signature. Signature validation will be ignored.

OPERATION PROGRESS STATUS
    * [2/10/2012 4:53:18 PM] : Activation of C:\Users\ibz\Downloads\MyApp.application has started.
    * [2/10/2012 4:53:18 PM] : Processing of deployment manifest has successfully completed.
    * [2/10/2012 4:53:18 PM] : Installation of the application has started.

ERROR DETAILS
    Following errors were detected during this operation.
    * [2/10/2012 4:53:18 PM] System.Deployment.Application.InvalidDeploymentException (Zone)
        - Deployment and application do not have matching security zones.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
            at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
            at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
            at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
            at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)

COMPONENT STORE TRANSACTION DETAILS
    No transaction information is available.

请帮我解决这个问题。

c# asp.net winforms clickonce
5个回答
1
投票

如果您收到上述错误,那么它不会认为您正在签署清单。请确保在“签名”选项卡中选中了复选框,并选择了有效的证书。另外,您是以完全信任还是部分信任方式发布此内容?如果进行部分信任,请将其更改为完全信任,尤其是在进行互联网安装时。


1
投票

Configure Visual Studio to include update location

这至少适用于VS2008项目:

属性 - >发布 - >更新 - >将更新位置设置为http://www.example.com/ApplicationName/

这将在<deploymentProvider codebase=... />文件中的<deployment>部分添加.application子部分。这个(至少)Chrome接受了。


1
投票

Downloading file breaks relative link

问题是错误消息应该是ExampleAppName.exe.manifest could not be found

如果您打开下载的ExampleAppName.application文件,您可以看到它可能指向Application Files\ExampleAppName.exe.manifest这样的路径,并且该文件在本地不存在。

它仍然适用于IE,因为IE启动安装程序而不下载文件。然后清单文件确实存在于ExampleAppName.application文件在Internet上的相对路径中。

手动转换为绝对链接

修复方法是更改​​ExampleAppName.application文件,并为其提供AppName.exe.manifest在Internet上存在的绝对路径。


0
投票

您需要安装适用于Chrome的ClickOnce Extension并启用它。您的应用程序将立即运行,而无需您单击下载的应用程序。


0
投票

在Visual Studio 2013中,我已验证此错误是由在项目的“发布”选项中选中“排除部署提供程序URL”引起的。

Project Properties > Publish > Options > Manifests > Un-tick "Exclude deployment provider URL"

作为额外的预防措施,请确保提供应用程序更新/安装所在的根URL:

Project Properties > Publish > Updates > Update Location (Provide the root URL where this application will be found)
© www.soinside.com 2019 - 2024. All rights reserved.