ClickOnce不遵守Localhost的安装文件夹 [英] ClickOnce Not Obeying Installation Folder for Localhost

查看:125
本文介绍了ClickOnce不遵守Localhost的安装文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试ClickOnce应用程序部署.我已经在我的机器上(运行IIS)设置了一个虚拟目录.我在Visual Studio的发布"选项卡中将 http://localhost/SampleApplication 指定为安装文件夹URL.但是,当我发布应用程序时,出现以下错误:

I'm testing a ClickOnce application deployment. I have setup a virtual directory on my machine (running IIS). I have specified http://localhost/SampleApplication as the Installation Folder URL in the Publish tab of Visual Studio. However, when I publish the application I get the following error:

警告:无法下载文件 来自 http://chrish/SampleApplication/.

Warning: Files could not be downloaded from http://chrish/SampleApplication/.

远程服务器返回错误: (407)需要代理身份验证. 发布成功.

The remote server returned an error: (407) Proxy Authentication Required. Publish success.

警告:无法 查看发布的应用程序,网址为 http://chrish/SampleApplication/publish.htm . http://chrish/SampleApplication/publish.htm

Warning: Unable to view published application at http://chrish/SampleApplication/publish.htm. http://chrish/SampleApplication/publish.htm

请注意,它是如何将我的URL从Localhost更改为我的登录名的.为什么?这不是一周前发生的事情.

Notice how it has changed my url from Localhost to my login name. Why? This wasn't happening a week ago.

推荐答案

ClickOnce安装涉及验证服务器名称是否与预期名称匹配.因此,localhost总是总是被翻译成计算机名[而不是您在问题中建议的用户名](ClickOnce所做的许多令人困惑的事情之一–如果您要设置3个下载服务器,则会产生副作用需要做3个单独的发布和/或像这样的发布 )或像这样.因此,这不足为奇-它总是在后台进行.

ClickOnce installation involves verifying that the server name matches the expected name. Thus localhost always gets translated under the covers to the computer name [not the username as you suggest in your question] (one of many confusing things ClickOnce does - one side effect of this is that if you want to set up 3 download servers, you need to do 3 separate publishes and/or script the publish like this) or like this. So this is not a surprise - it's always doing that under the covers.

407错误与代理身份验证有关.这意味着下载正在通过诸如Microsoft ISA Server之类的代理转移.查看您的IE Internet选项连接代理设置,并确保绕过本地地址(例如chrish].

The 407 error relates to proxy auth. This implies downloading is being diverted via a proxy such as Microsoft ISA Server. Have a look in your IE Internet Options Connections Proxy Settings and make sure its bypassing for local addresses [such as chrish].

报告成功的原因是,上载可能使用的是验证以外的机制,并且没有通过/阻止路由. (潜在的问题是,.NET框架默认情况下不会传递代理凭据,因此您需要应用devenv的配置项或进行任何发布或使构建过程调用带有发送可发送代理凭证的额外代码的测试步骤](如何设置默认代理以使用默认凭据?)

The reason it's reporting success is that the upload likely uses an alternate mechanism than the verification does and isn't being routed via / blocked by the proxy. (The underlying problem is that the .NET framework does not by default pass proxy credentials and you'd need to either apply a config entry for devenv or whatever does the publish or have the build process call a test step with extra code that does send the proxy credentials](http://blogs.msdn.com/jpsanders/archive/2009/03/24/httpwebrequest-webexcepton-the-remote-server-returned-an-error-407-proxy-authentication-required.aspx). See also How should I set the default proxy to use default credentials?)

这篇关于ClickOnce不遵守Localhost的安装文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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