加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

.net – ClickOnce部署CheckForDetailedUpdate抛出异常

发布时间:2020-12-14 05:31:32 所属栏目:Windows 来源:网络整理
导读:我有一个全天候运行而没有出席的应用程序.它通过 ClickOnce部署,需要自行检查和下载更新.它会在应用程序启动时和晚上的预定时间检查更新.当它在启动时执行它,它完全正常. 但是,当它在预定时间执行时,它会崩溃.在这两种情况下,它都使用完全相同的代码.它在Win
我有一个全天候运行而没有出席的应用程序.它通过 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()

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

解决方法

我将此链接仅用于记录: link to MSDN forum.根据它,它是ClickOnce内部的一个错误,导致在CheckForDetailedUpdate()函数的一定数量的调用之后出现此错误.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读