VSTO Error System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

0

When I try to debug Excel workbook (VSTO) in Visual studio 2015 Enterprice, I get following error,

enter image description here

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

The exception text:

System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

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.DeploymentManager..ctor(Uri deploymentSource, Boolean isUpdate, Boolean isConfirmed, DownloadOptions downloadOptions, AsyncOperation optionalAsyncOp)

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

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

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

at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.GetManifests(TimeSpan timeout)

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

c#
.net
excel
vsto
asked on Stack Overflow Jun 18, 2018 by Kasun Sameera Madhusanka • edited Jun 18, 2018 by Pearly Spencer

1 Answer

0

You are missing one or more of the files in your deployment. Most probably you have something installed in the GAC on other machines, but the current one doesn't have a component or referenced assembly installed.

You can try turning on the enhanced logging and checking out the results. It might pinpoint exactly what file is missing. You can read more about this in the Enhanced Logging in ClickOnce Deployment article. Also I've found a similar forum thread - GetUserStore throws FileNotFoundException.

answered on Stack Overflow Jun 18, 2018 by Eugene Astafiev

User contributions licensed under CC BY-SA 3.0