简体   繁体   中英

VSTO Can't Read App.Config

After deploying a VSTO Excel Add-In I am unable to read the app.config file.

My question is identical to this one:

VSTO Debug version fine, Installed version doesn't read app.config

Except, when I change the registry entry to use the file:/// as suggested in the post I get the following error:

The common language runtime could not be loaded by file:///C:\\Program Files (x86)\\company\\product\\addin.vsto|vstolocal. Contact your administrator for further assistance.

Without using file:/// the Add-In loads fine but doesn't read the configuration file.

I am using the following software:

  • Excel 2010 (installed - 32bit)
  • VSTO 2010 (10.0.60724 - 64bit)
  • Windows 7 (64-bit)
  • .NET (4.6.00081)

The link here says that based on my software I needed to install the 64bit of VSTO:

https://msdn.microsoft.com/en-us/library/bb608603.aspx?f=255&MSPPError=-2147217396

I tried to install .NET 4.0 and .NET 4.5 but as 4.6 is installed it won't continue. 4.6 is required by the add-in.

Is there something I am missing that is required to get this to work?

I managed to resolve this. The problem was that InstallShield does not contain a prerequisite of .NET 4.6.1 yet and so the developer had selected .NET 4.6 instead, however when the Add-In loads it looks for the exact version of .NET it requires which was not part of the installation.

To resolve, I removed .NET 4.6 and installed 4.6.1 manually.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM