ClickOnce 安装期间出现 FileNotFoundException,缺少 HKCU\Software\Classes\Software

发布于 2024-12-09 21:31:25 字数 1776 浏览 0 评论 0原文

我们的一位用户在使用 ClickOnce 时遇到了非常严重的问题。这是一个典型的错误:

     Following errors were detected during this operation.  * [14/10/2011 01:40:25] System.IO.FileNotFoundException
      - The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
      - Source: System.Deployment
      - Stack trace:    
at System.Deployment.Internal.Isolation.IsolationInterop.GetUserStore(UInt32 Flags, IntPtr hToken, Guid& riid)    
at System.Deployment.Internal.Isolation.IsolationInterop.GetUserStore()   
at System.Deployment.Application.ComponentStore..ctor(ComponentStoreType storeType, SubscriptionStore subStore)    
at System.Deployment.Application.SubscriptionStore..ctor(String deployPath, String tempPath, ComponentStoreType storeType)    
at System.Deployment.Application.SubscriptionStore.get_CurrentUser()    
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)    at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)

但传统的解决方案都不起作用。我们尝试过:

  1. 删除清单中与应用程序相关的文件夹和文件
  2. 删除 2.0 文件夹
  3. 删除 App 文件夹
  4. 运行 mage -cc
  5. 杀死 dfsvc.exe 并重试(每次失败时都会加载 dfsvc)

我在 .NET 3.5 和 .NET 中发布了一个 helloworld 应用程序4.0 并将整个 \publish 文件夹复制到他的计算机上。这也没有安装,给出同样的错误。最后,我去注册表尝试为 RobinDotNet 添加增强日志记录,并意识到 HKCU\Software\Classes\Software 完全丢失。遵循更多线程,我将其重命名为 UsrClass.dat。然而,注销并登录后,并没有重建。我怀疑这可能是问题所在。关于如何让 ClickOnce 再次工作有什么想法吗?

这是相当全新的 Windows 7 Professional 安装。

更新这是另一条线索。我们可以将 UsrClass.dat 重命名为任何名称或将其删除,而 Windows 不会发出任何投诉 - 因此它不会被加载。在我的机器上,它抱怨它正在使用中。

One of our users has a very serious problem with ClickOnce. The error is a classic one:

     Following errors were detected during this operation.  * [14/10/2011 01:40:25] System.IO.FileNotFoundException
      - The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
      - Source: System.Deployment
      - Stack trace:    
at System.Deployment.Internal.Isolation.IsolationInterop.GetUserStore(UInt32 Flags, IntPtr hToken, Guid& riid)    
at System.Deployment.Internal.Isolation.IsolationInterop.GetUserStore()   
at System.Deployment.Application.ComponentStore..ctor(ComponentStoreType storeType, SubscriptionStore subStore)    
at System.Deployment.Application.SubscriptionStore..ctor(String deployPath, String tempPath, ComponentStoreType storeType)    
at System.Deployment.Application.SubscriptionStore.get_CurrentUser()    
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)    at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)

But none of the traditional solutions worked. We tried:

  1. Delete folders and files in manifest related to the application
  2. Delete 2.0 folder
  3. Delete App folder
  4. Run mage -cc
  5. Kill dfsvc.exe and try again (dfsvc gets loaded everytime it fails)

I published a helloworld app in .NET 3.5 and .NET 4.0 and copied the entire \publish folder to his machine. This also did not install, giving the same error. Finally, I went to the registry to try to add enhanced logging per RobinDotNet and realized that HKCU\Software\Classes\Software was completely missing. Following some more threads, I went and renamed UsrClass.dat. However, after logging off and logging in, this was not rebuilt. I suspect this maybe the issue. Any thoughts on how to get ClickOnce working again?

This is a reasonably fresh Windows 7 Professional install.

Update Here's another clue. We are able to rename UsrClass.dat to anything or delete it without any complaint from Windows - so it is not being loaded. On my machine it complains that it is under use.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

默嘫て 2024-12-16 21:31:25

我想说忘记 ClickOnce 并解决注册表问题。对于 StackOverflow 来说,这可能不是一个正确的主题,更像是 SuperUser.com...

无论如何:
1) 尝试系统还原,看看是否可以找到该注册表配置单元存在的状态,您可能需要返回很多周。
2) 尝试从您的计算机导出该注册表配置单元并将其导入客户端计算机。看看错误是否消失或者是否抱怨不同的配置单元 - 注册表可能已损坏并且还丢失了其他配置单元...
3)如果这两个不能解决问题,那么您最好进行全新安装(这比查找问题的确切原因更快,并且您可以确定一切都会得到解决)
4)最后卸载任何注册表清理或电脑调整软件。众所周知,它们会引起问题,注册表损坏就是其中之一。还要检查硬件问题,HDD 可能已形成坏块,或者 RAM 可能有故障(运行 MemTest 3 遍以上以确保确定)...

I would say forget about ClickOnce and get that registry sorted out. This probably isn't a correct topic for StackOverflow, more like SuperUser.com...

Anyway:
1) Try a System Restore, see if you can find a state where that registry hive exists, you might have to go back many weeks.
2) Try exporting that registry hive from your machine and import it into the client machine. See if the error goes away or if it complains about a different hive - it might be possible that the registry is corrupt and there are other hives missing as well...
3) If these two don't fix the problem, then you are better of doing a clean install (it will be faster than looking for the exact cause of the problem and you can be sure that everything will be fixed)
4) Finally uninstall any registry cleaner or pc tuning software. They are known to cause problems, registry corruption being one of them. Also check for hardware issues, the HDD might have developed a bad block(s) or the RAM maybe faulty (run MemTest for 3+ passes to be sure)...

來不及說愛妳 2024-12-16 21:31:25

尝试卸载它然后重新安装!我确信它应该有效。

Try uninstalling it and then reinstall it ! I'm sure it should work.

茶花眉 2024-12-16 21:31:25

尝试删除以下文件夹:

C:\Users\username\AppData\Local\Apps\2.0\

Data 文件夹除外。

您还应该删除 .NET Framework 临时文件:

C:\WINDOWS\Microsoft.NET\Framework\<version>\Temporary ASP.NET Files

Try deleting folders under:

C:\Users\username\AppData\Local\Apps\2.0\

Except Data folder.

You should delete .NET Framework temporary files too:

C:\WINDOWS\Microsoft.NET\Framework\<version>\Temporary ASP.NET Files
眼泪淡了忧伤 2024-12-16 21:31:25

尝试使用清理注册表的工具。我从未经历过这种情况,但我认为与您的应用程序或清单无关,请检查可能导致该用户计算机中出现此问题的软件或工具。

Try a tool for cleaning the registry. I've never experienced that but I think is not related to your application nor the manifest, check a software or tool that could be causing this problem in that user's computer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文