Friday, May 2, 2014

ClickOnce deployment error

Many WPF applications will use ClickOnce to deploy to the user's desktop. ClickOnce is fairly stable once you have it configured properly but can be obtuse when problems occur.

I recently asked a tester to download the latest version of my application and she received an error that the application could not be installed. There was nothing useful in the error she saw, but there was an [OK] and a [Details] button. I told her to click the [Details] button and a very useful looking window opened up with all sorts of interesting information.

I looked at the report and saw the following errors...

 * [5/2/2014 10:36:39 AM] : Activation of http://it86174/Purchasing/Purchasing.application?IsLogging=true&UserName=adminps&Password=MGIGCSsGAQQBgjdYA6BVMFMGCisGAQQBgjdYAwGgRTBDAgMCAAECAmYCAgIAgAQI%0d%0awKA0Mv71ERgEENxnHBqsX0ogs6bxtYoAIb4EGN0uXW%2bdLanne%2fQgo5hvEgbld1kb%0d%0anQX%2fmg%3d%3d&District=86&FiscalYear=2014&SessionID=ucd1fyqw5yidrnafufoy2ek2 has started.
 * [5/2/2014 10:36:43 AM] : Processing of deployment manifest has successfully completed.
 * [5/2/2014 10:36:43 AM] : Installation of the application has started.
 * [5/2/2014 10:36:43 AM] : Processing of application manifest has successfully completed.
 * [5/2/2014 10:36:43 AM] : Found compatible runtime version 4.0.30319.
 * [5/2/2014 10:36:43 AM] : Request of trust and detection of platform is complete.
 * [5/2/2014 10:36:45 AM] : Downloading of subscription dependencies is complete.
 * [5/2/2014 10:36:45 AM] : Commit of the downloaded application has started.

 Following errors were detected during this operation.
 * [5/2/2014 10:36:47 AM] System.Runtime.InteropServices.COMException
  - A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)
  - Source: System.Deployment
  - Stack trace:
   at System.Deployment.Internal.Isolation.IStateManager.Scavenge(UInt32 Flags, UInt32& Disposition)
   at System.Deployment.Application.ComponentStore.SubmitStoreTransaction(StoreTransactionContext storeTxn, SubscriptionState subState)
   at System.Deployment.Application.ComponentStore.SubmitStoreTransactionCheckQuota(StoreTransactionContext storeTxn, SubscriptionState subState)
   at System.Deployment.Application.ComponentStore.CommitApplication(SubscriptionState subState, CommitApplicationParams commitParams)
   at System.Deployment.Application.SubscriptionStore.CommitApplication(SubscriptionState& subState, CommitApplicationParams commitParams)
   at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
   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)

This told me that the manifest had been processed and the problem was in the download of the payload. The important line is "A device attached to the system is not functioning."

Googling this error results in a lot of results but did not reveal the actual solution for me. I've actually seen the same error before on web sites. The solution in the past has always been to restart IIS. As the content of my ClickOnce application is hosted by IIS I gave it a try. It worked.

I went back to the tester and had her try again. Problem solved.

Interestingly I had no problem downloading the application on the same machine that was hosting it. This suggests that at least part of IIS is not involved in local installations.

Anyhow, if you see this error during a ClickOnce installation try restarting IIS on the hosting machine.

No comments:

Post a Comment