windows 是什么导致 ClickOnce URLDownloadToCacheFile 在安装过程中失败?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1733717/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 13:26:43  来源:igfitidea点击:

What causes ClickOnce URLDownloadToCacheFile failed during installation?

windowsclickonce

提问by Luke

I'm getting the following error when installing my ClickOnce application via firefox. It doesn't happen with IE on the same computer. I swear I've installed it via firefox before. This is a Windows 7 machine.

通过 Firefox 安装 ClickOnce 应用程序时出现以下错误。同一台计算机上的 IE 不会发生这种情况。我发誓我以前通过 Firefox 安装过它。这是一台 Windows 7 机器。

The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [ProcessorArchitecture] = Intel {string}
Property: [VersionNT] = 6.1.0 {version}
Running checks for package '.NET Framework 2.0 (x86)', phase BuildList
Running external check with command 'C:\Users\luke\AppData\Local\Temp\VSDEF1A.tmp\DotNetFX\dotnetchk.exe' and parameters ''
Process exited with code 1
Setting value '1 {int}' for property 'DotNetInstalled'
Reading value 'Version' of registry key 'HKLM\Software\Microsoft\Internet Explorer'
Read string value '8.0.7600.16385'
Setting value '8.0.7600.16385 {string}' for property 'IEVersion'
The following properties have been set for package '.NET Framework 2.0 (x86)':
Property: [DotNetInstalled] = 1 {int}
Property: [IEVersion] = 8.0.7600.16385 {string}
Running checks for command 'DotNetFX\instmsia.exe'
Result of running operator 'ValueExists' on property 'VersionNT': true
Result of checks for command 'DotNetFX\instmsia.exe' is 'Bypass'
Running checks for command 'DotNetFX\WindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'ValueExists' on property 'Version9x': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.0.3': false
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.0': true
Result of checks for command 'DotNetFX\WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
Running checks for command 'DotNetFX\dotnetfx.exe'
Result of running operator 'ValueNotEqualTo' on property 'DotNetInstalled' and value '0': true
Result of checks for command 'DotNetFX\dotnetfx.exe' is 'Bypass'
'.NET Framework 2.0 (x86)' RunCheck result: No Install Needed
Launching Application.
URLDownloadToCacheFile failed with HRESULT '-2146697211'
Error: An error occurred trying to download 'http://croppy.lukehunter.net/download/croppy.application'.

The following is the howto from Microsoft, but this doesn't apply to firefox. There is no redirection happening either.

以下是来自 Microsoft 的 howto,但这不适用于 firefox。也没有发生重定向。

If a user has set Internet Explorer Advanced Security option "Warn if changing between secure and not secure mode" on the deployment target computer, and if the setup URL of the ClickOnce application being installed is redirected from a non-secure to a secure site (or vice-versa), the installation will fail because the Internet Explorer warning interrupts it.

如果用户在部署目标计算机上设置了 Internet Explorer 高级安全选项“在安全模式和非安全模式之间切换时发出警告”,并且正在安装的 ClickOnce 应用程序的设置 URL 从非安全站点重定向到安全站点(反之亦然),安装将失败,因为 Internet Explorer 警告中断了它。

回答by Vadim Kuznetsov

Internet Explorercalls either LaunchApplicationor ShOpenVerbApplicationprocedure from dfshim.dll behind the scenes, whereas Firefoxplug-in (as well as a standard bootstrapper created by Visual Studio 2008-2010, which could also produce this rare error) uses a different, out of date technique to launch ClickOnce applications. (Note, that LaunchApplicationrequires at least .NET Framework 2 SP 2.)

Internet Explorer在幕后从 dfshim.dll调用LaunchApplicationShOpenVerbApplication过程,而Firefox插件(以及由 Visual Studio 2008-2010 创建的标准引导程序,也可能产生这种罕见的错误)使用不同的日期技术来启动 ClickOnce 应用程序。(请注意,LaunchApplication至少需要 .NET Framework 2 SP 2。)

To avoid such error one could redirect Internet Explorerto a deployment manifest (.application) and all other browsers to a custom installer (.exe) that would install .NET Framework if necessary and then call ShOpenVerbApplication.

为避免此类错误,可以将Internet Explorer重定向到部署清单 (.application) 并将所有其他浏览器重定向到自定义安装程序 (.exe),该程序将在必要时安装 .NET Framework,然后调用ShOpenVerbApplication

回答by Luke

Hmm, after using IE to install, then uninstalling, I was able to install via firefox again. Odd.

嗯,用IE安装,然后卸载后,又可以通过firefox安装了。奇怪的。

回答by Ernani Torquato

The following worked for me:

以下对我有用:

Within the local distribution package CLICK ONCE a web.config file was generated on line clientCache that was the problem, in which altered as follows for CHROME and IE8 and now run the file:

在本地分发包中,单击一次,在 clientCache 线上生成了一个 web.config 文件,这是问题所在,其中针对 CHROME 和 IE8 进行了如下更改,现在运行该文件:

<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00" />

回答by Dave

I've had this and it to resolve it was to disable the firewall. I sadly don't know what Firewall settings it was, I just disabled the lot and it ran/installed without issue.

我遇到过这个问题,解决它的方法是禁用防火墙。遗憾的是,我不知道它是什么防火墙设置,我只是禁用了很多,并且它运行/安装没有问题。

回答by B.M.

After exhausting firewall options on this issue, I found that my excutable was pointing to the IP Address of the Application Server. When I changed the site deployment and consequently the executable to the FQDN of the server instead of the IP Address, the installer worked first time.

在用尽关于这个问题的防火墙选项后,我发现我的可执行文件指向了应用程序服务器的 IP 地址。当我更改站点部署并因此将可执行文件更改为服务器的 FQDN 而不是 IP 地址时,安装程​​序第一次运行。

回答by José Donoso

Simple Solution, on cmd execute setup.exe /URL=http://< Production? URL>/

简单的解决方案,在 cmd 上执行 setup.exe /URL=http://< Production? 网址>/

Easy!

简单!