How can I use my Proxy credentials when installing a Clickonce application?

允我心安 提交于 2019-12-08 01:32:16

问题


I am using an authenticated proxy to connect to the internet. The proxy settings are listed in Control Panel, and I get a user/password dialog box the first time I connect to a website.

While it normally works fine, when I launched a Clickonce application that needed to download files from the internet, I got this error:

Application download did not succeed. Check your network connection, or contact your system administrator or network service provider.

I went into the log file, and found this:

ERROR DETAILS
    Following errors were detected during this operation.
    * [22/12/2012 15:19:25] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
        - Downloading http://#######.###/########.application did not succeed.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
            at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
            at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
            at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
            at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
            at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
            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.Net.WebException
        - The remote server returned an error: (407) Proxy Authentication Required.
        - Source: System
        - Stack trace:
            at System.Net.HttpWebRequest.GetResponse()
            at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)

I've added the credentials to the "My Credentials" section in user settings, but it still did not work.

Is there any way to download files for a Clickonce application, via an authenticated proxy?


回答1:


Googling "proxy credentials in clickonce" and filtering for results within the past year I found this work-around.

How to use ClickOnce with proxy authentication: http://www.0x00.to/post/2012/12/31/How-to-use-ClickOnce-with-proxy-authentication

EDIT

https://github.com/mc-kay/ClickOnceWithProxySupport



来源:https://stackoverflow.com/questions/14126504/how-can-i-use-my-proxy-credentials-when-installing-a-clickonce-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!