ClickOnce deployment CheckForDetailedUpdate throws an exception

5

I have an application that's running 24/7 without attendance. It's deployed via ClickOnce and needs to check and download updates by itself. It checks for updates at application startup and at scheduled time at night. When it does it on startup, it works perfectly fine.

However, when it does it at scheduled time, it crashes. In both cases it's using exactly the same piece of code. It's running under Windows 7 and might have something to do with UAC. I'm thinking that maybe it cannot access file system when computer is at idle state? I really need to fix that. Here are the exception details:

Message:

A privilege that the service requires to function properly does not exist in the service account configuration. You may use the Services Microsoft Management Console (MMC) snap-in (services.msc) and the Local Security Settings MMC snap-in (secpol.msc) to view the service configuration and the account configuration. (Exception from HRESULT: 0x80070511)

Stack trace:

at System.Deployment.Internal.Isolation.IStore.GetAssemblyInformation(UInt32 Flags, IDefinitionIdentity DefinitionIdentity, Guid& riid)
at System.Deployment.Internal.Isolation.Store.GetAssemblyManifest(UInt32 Flags, IDefinitionIdentity DefinitionIdentity)
   at System.Deployment.Application.ComponentStore.GetAssemblyManifest(DefinitionIdentity asmId)
   at System.Deployment.Application.ComponentStore.GetSubscriptionStateInternal(DefinitionIdentity subId)
   at System.Deployment.Application.SubscriptionStore.GetSubscriptionStateInternal(SubscriptionState subState)
   at System.Deployment.Application.DeploymentManager.BindCoreWithAppId(Boolean blocking, FileStream& refTransaction, String& productName)
   at System.Deployment.Application.DeploymentManager.BindCore(Boolean blocking, TempFile& tempDeploy, TempDirectory& tempAppDir, FileStream& refTransaction, String& productName)
   at System.Deployment.Application.DeploymentManager.Bind()
   at System.Deployment.Application.ApplicationDeployment.CheckForDetailedUpdate(Boolean persistUpdateCheckResult)
   at AdvancedKiosks.Utils.Updating.Updater.get_UpdateAvailabilityStatus()
   at AdvancedKiosks.Utils.Updating.Updater.get_CanUpdate()
   at AdvancedKiosks.DKMS.ViewModel.MainViewModel.<.ctor>b__6()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

EDIT: I think the cause might be that the hard disk drive is turning off after some time of the system being idle. Is there a way to programatically turn on the hard disk drive before I check for updates (using C#)?

.net
deployment
windows-7
clickonce
uac
asked on Stack Overflow Mar 7, 2012 by Martynas • edited Mar 24, 2015 by Peter Mortensen

1 Answer

5

I will put this link here just for the record: link to MSDN forum. According to it, it's a bug in ClickOnce internals which causes this error to appear after certain number of calls to the CheckForDetailedUpdate() function.

answered on Stack Overflow Dec 4, 2012 by avs099 • edited Mar 16, 2015 by Peter Mortensen

User contributions licensed under CC BY-SA 3.0