I have an application that works 24 hours a day without participation. It is deployed through ClickOnce and must check for and download updates itself. It checks for updates when the application starts and at the scheduled time at night. When he does this at startup, it works great.
However, when he does this at the scheduled time, he crashes. In both cases, it uses exactly the same piece of code. It runs on Windows 7 and may have something to do with UAC . I think that maybe he cannot access the file system when the computer is in standby mode? I really need to fix this. Here is the exception information:
Message:
Privileges that the service must perform correctly do not exist in the service account configuration. You can use the Microsoft Management Console (MMC) Services Console (services.msc) and the MMC Local Security Settings snap-in (secpol.msc) to view the configuration service and 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 reason may be that the hard drive shuts down after some time of system inactivity. Is there a way to programmatically turn on the hard drive before I check for updates (using C #)?
source share