How can I use my Proxy credentials when installing

2019-05-23 13:41发布

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条回答
2楼-- · 2019-05-23 14:20

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

查看更多
登录 后发表回答