Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Using an app.config file is a great way to load settings for your add-in at runtime and the VSTO 4.0 runtime supports this, but what you might not know is that a small change in VSTO 4.0 SP1 might keep your app.config file from loading.
Here is a blog post from the Visual Studio Office Development Support team that describes the situation and a suggested fix…https://blogs.msdn.com/b/vsod/archive/2011/06/14/vsto-4-0-sp1-will-cause-a-vsto-addin-to-not-find-its-config-file.aspx
This post was helpful and resolved the issue so that my config file could be loaded when my add-in was running with Excel 2010 as the host application. However this did not resolve the problem entirely because I setup my add-in to support both Excel 2010 and Excel 2007. If Excel 2007 attempts to load my add-in with the Manifest setting set to file:///… the add-in actually gets set to Inactive and does not load in Excel.
A quick fix that supports both 2007 and 2010
All you need to do is use file:// ( notice only 2 / characters ) instead of file:/// and your config file will get loaded in both the 2007 host and the 2010 host.
Note: I have not tested this with all VSTO 4.0 host applications like Word, PowerPoint and Visio but I assume they would all have this issue as they all share the VSTO 4.0 runtime.
- Anonymous
June 05, 2013
This was a huge breakthrough for a similar problem I had with an Excel Document Level VSTO solution I developed. Certain machines appeared to ignore changes to the *.dll.config file while others worked fine. I believe I had the same issue described above however I'm working with a document level customization and not an application add-in.Changing the _AssemplyLocation under custom advanced properties of the workbook with the customizationfrom: solutionName.vsto|8x4x73x8-d2xb-43x3-9x0x-e7x43fxf3xd3|vstolocalto: file://C:/Program Files (x86)/solutionInstallPath/solutionName.vsto|8x4x73x8-d2xb-43x3-9x0x-e7x43fxf3xd3|vstolocalsorted out these issues and settings in configuration file worked again.Figured I'd add a comment for anyone looking for similar problem. I spent many hours looking for a solution.-Derek