ClickOnce 不遵守本地主机的安装文件夹

发布于 2024-07-17 16:57:21 字数 827 浏览 6 评论 0原文

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

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

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

警告:无法 查看已发布的申请 http://chrish/SampleApplication/publish.htmhttp://chrish/SampleApplication/publish.htm

请注意它如何将我的网址从 Localhost 更改为我的登录名。 为什么? 一周前这还没有发生。

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:

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

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

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

望笑 2024-07-24 16:57:21

ClickOnce 安装涉及验证服务器名称是否与预期名称匹配。 因此 localhost 总是在幕后被翻译为计算机名称 [而不是您在问题中建议的用户名](ClickOnce 所做的许多令人困惑的事情之一 - 这样做的一个副作用是,如果您想设置 3 个下载服务器,您需要进行 3 次单独的发布和/或 像这样编写发布脚本 )或这样。 所以这并不奇怪——它总是在幕后做这件事。

407 错误与代理身份验证有关。 这意味着下载正在通过 Microsoft ISA Server 等代理进行转移。 查看 IE Internet 选项连接代理设置并确保其绕过本地地址 [例如 chrish]。

它报告成功的原因是上传可能使用了验证之外的替代机制,并且没有通过代理路由/被代理阻止。 (根本问题是 .NET 框架默认情况下不会传递代理凭据,您需要 应用 devenv 的配置条目 或发布或让构建过程使用发送代理凭据的额外代码调用测试步骤的任何内容](http://blogs.msdn .com/jpsanders/archive/2009/03/24/httpwebrequest-webexcepton-the-remote-server-returned-an-error-407-proxy-authentication-required.aspx 另请参阅我应该如何设置默认代理以使用默认凭据?)

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.

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].

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?)

江湖彼岸 2024-07-24 16:57:21

ClickOnce 不喜欢“localhost”,但您可以解决这个问题。

如果将发布文件夹位置设置为:

C:\inetpub\wwwroot\SampleApplication\

,并将安装文件夹 URL 设置为:

http:// chrish/SampleApplication/

(其中“chrish”是您计算机的网络名称),然后您可以在本地发布。

ClickOnce doesn't like "localhost", but you can work around that.

If you set the Publishing Folder Location to:

C:\inetpub\wwwroot\SampleApplication\

and the Installation Folder URL to:

http://chrish/SampleApplication/

(where "chrish" is the network name of your computer) then you can publish locally.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文