gpt4 book ai didi

.net - ClickOnce 部署 CheckForDetailedUpdate 抛出异常

转载 作者:行者123 更新时间:2023-12-04 22:11:48 38 4
gpt4 key购买 nike

我有一个 24/7 无人值守的应用程序。它是通过 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, 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()

编辑:我认为原因可能是硬盘驱动器在系统空闲一段时间后关闭。在检查更新(使用 C#)之前,有没有办法以编程方式打开硬盘驱动器?

最佳答案

我会把这个链接放在这里只是为了记录:link to MSDN forum .根据它,这是 ClickOnce 内部的一个错误,导致在调用 CheckForDetailedUpdate() 函数一定次数后出现此错误。

关于.net - ClickOnce 部署 CheckForDetailedUpdate 抛出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9603847/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com