【问题标题】:VSTO Error System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)VSTO 错误 System.IO.FileNotFoundException:系统找不到指定的文件。 (来自 HRESULT 的异常:0x80070002)
【发布时间】:2018-06-18 07:57:24
【问题描述】:

当我尝试在 Visual Studio 2015 Enterprice 中调试 Excel 工作簿 (VSTO) 时,出现以下错误,

来自:file:///c:/users/sameera.madhusanka/documents/visual studio 2015/Projects/ClassLibrary1/ExcelWorkbook2/bin/Debug/ExcelWorkbook2.vsto

异常文本:

System.IO.FileNotFoundException:系统找不到指定的文件。 (HRESULT 异常:0x80070002)

在 System.Deployment.Internal.Isolation.IsolationInterop.GetUserStore(UInt32 Flags, IntPtr hToken, Guid&riid)

在 System.Deployment.Internal.Isolation.IsolationInterop.GetUserStore()

在 System.Deployment.Application.ComponentStore..ctor(ComponentStoreType storeType, SubscriptionStore subStore)

在 System.Deployment.Application.SubscriptionStore..ctor(String deployPath, String tempPath, ComponentStoreType storeType)

在 System.Deployment.Application.SubscriptionStore.get_CurrentUser()

在 System.Deployment.Application.DeploymentManager..ctor(Uri deploymentSource, Boolean isUpdate, Boolean isConfirmed, DownloadOptions downloadOptions, AsyncOperation optionalAsyncOp)

在 System.Deployment.Application.InPlaceHostingManager..ctor(Uri deploymentManifest, Boolean launchInHostProcess)

在 Microsoft.VisualStudio.Tools.Applications.Deployment.IPHMProxy..ctor(Uri uri)

在 Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.get_Proxy()

在 Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.GetManifests(时间跨度超时)

在 Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()

【问题讨论】:

  • 不就是你没有标记要复制的文件吗?因此它只存在于您的代码存储库中,而不存在于您的编译版本中?在解决方案资源管理器、属性资源管理器中查看文件属性,然后选择“始终复制”应该可以修复它吗?
  • 感谢 Morten,我将它们更改为在本地复制。但它仍然显示错误...

标签: c# .net excel vsto


【解决方案1】:

您的部署中缺少一个或多个文件。很可能您在其他机器上的 GAC 中安装了一些东西,但当前的机器没有安装组件或引用的程序集。

您可以尝试打开增强的日志记录并查看结果。它可能会准确指出丢失的文件。您可以在Enhanced Logging in ClickOnce Deployment 文章中阅读更多相关信息。我还发现了一个类似的论坛主题 - GetUserStore throws FileNotFoundException

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-05-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多