I am developing an outlook addin with VSTO for Outlook 2016.
In my deployment, I have a config file which is located in the same directory as the .dll and the .vsto files, aswell as all the other .dll's that are referenced in the addin.
Is it possible at all, to programmatically get the directory, where the .vsto (and my config file) is located. For example the directory where the VSTO would be deployed to could be: "D:\MyPlugins\PluginX\pluginx.vsto"
I tried various constants / methods that would usually work with a "normal" application, i.e:
- Environment.CurrentDirectory
- Directory.GetCurrentDirectory()
- Assembly.Location / Assembly.CodeBase
- System.Windows.Forms.Application.StartupPath
and while most of them work in debug mode when I start the plugin with Visual Studio, obviously none of them work, because when you install a VSTO, your assembly gets copied to some generated directory.