ClickOnce部署CheckForDetailedUpdate引发异常 [英] ClickOnce deployment CheckForDetailedUpdate throws an exception

查看:177
本文介绍了ClickOnce部署CheckForDetailedUpdate引发异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个24/7全天候运行的应用程序。它是通过 ClickOnce 部署的,需要自行检查和下载更新。它在应用程序启动时和晚上的计划时间检查更新。

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.

但是,当它在计划的时间执行时,它崩溃了。在两种情况下,它都使用完全相同的代码。它可以在Windows 7下运行,并且可能与 UAC 有关。我在想,也许它在计算机处于空闲状态时无法访问文件系统?我真的需要解决这个问题。以下是异常详细信息:

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:

消息:


该服务的特权服务帐户配置中不存在
要求正常运行。您可以使用服务
Microsoft管理控制台(MMC)管理单元(services.msc)和
本地安全设置MMC管理单元(secpol.msc)查看服务
配置和帐户配置。 (来自HRESULT的异常:
0x80070511)

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#)之前,是否可以通过编程方式打开硬盘驱动器?

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#)?

推荐答案

我将在此处放置此链接仅供参考:链接到MSDN论坛。根据它的说法,这是ClickOnce内部的一个错误,该错误导致在调用CheckForDetailedUpdate()函数一定次数后出现此错误。

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.

这篇关于ClickOnce部署CheckForDetailedUpdate引发异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆