我有一个全天候运行而没有出席的应用程序.它通过
ClickOnce部署,需要自行检查和下载更新.它会在应用程序启动时和晚上的预定时间检查更新.当它在启动时执行它,它完全正常.
但是,当它在预定时间执行时,它会崩溃.在这两种情况下,它都使用完全相同的代码.它在Windows 7下运行,可能与UAC有关.我在想,当计算机处于空闲状态时,它可能无法访问文件系统?我真的需要解决这个问题.以下是异常详细信息:
信息:
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)
堆栈跟踪:
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,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,Object state) at System.Threading.ThreadHelper.ThreadStart()@H_403_29@编辑:我认为原因可能是系统闲置一段时间后硬盘驱动器正在关闭.有没有办法在检查更新之前以编程方式打开硬盘驱动器(使用C#)?