从ASP.NET WebForms应用程序部署期间,ClickOnce组件DeploymentUriDifferent异常

时间:2017-02-09 18:00:27

标签: c# asp.net exception deployment clickonce

我们有一个ClickOnce组件安装在客户端计算机上,当用户单击URL(在IE11中)时,该组件在Word中打开docx文件。当我们将组件的新版本部署到我们的QA服务器进行测试时,它在安装过程中开始失败,并且使用以下DeploymentException这是没有意义的,因为这对所有先前版本都适用。

有什么想法吗?

ERROR DETAILS
Following errors were detected during this operation.
* [08/02/2017 3:56:03 PM] System.Deployment.Application.DeploymentException (DeploymentUriDifferent)
    - You cannot start application Company Name Document Handler from this location because it is already installed from a different location.
    - Source: System.Deployment
    - Stack trace:
        at System.Deployment.Application.ApplicationActivator.CheckDeploymentProviderValidity(ActivationDescription actDesc, SubscriptionState subState)
        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)
    --- Inner Exception ---
    System.Deployment.Application.DeploymentException (DeploymentUriDifferent)
    - You cannot start application Company Name Document Handler from location http://QAserver/Project.Name/ClickOnce/Project.Name.ClickOnce.application 
    it is already installed from location http://localhost/Project.Name.WebClient/ClickOnce/Project.Name.ClickOnce.application. 
    You can start it from location http://localhost/Project.Name.WebClient/ClickOnce/Project.Name.ClickOnce.application 
    or you can uninstall it and reinstall it from location http://QAserver/Project.Name/ClickOnce/Project.Name.ClickOnce.application. 
    If you reinstall the application, be aware that you might lose any customizations that you made to the application.

1 个答案:

答案 0 :(得分:0)

嗯,问题结果与我们的ClickOnce.csproj文件中的设置更改有关,我们没有意识到这是由我们的某个开发人员签到的。 具体来说,当Install设置为trueDisallowUrlActivation设置为false时,我们遇到了问题。将这些设置更改回原来修复了ClickOnce安装的所有问题:

<Install>false</Install>
<DisallowUrlActivation>true</DisallowUrlActivation>

希望这有助于其他人...