I have an word add in application created in c# which is accessing a web service and is perfectly working if installed outside Program Files folder. the weird thing is that
The machine .config file specifies the settings that are global to a particular machine - so whatever you changed can potentially affect every other app on the machine.
The App config contains application specific settings so your applications settings really should be in there.
When you built and deployed your application to Program Files was the app config copied along with it? Did you set the "Copy to Output Directory" property?
If your library.dll is called from application app.exe you will need to have app.exe.config, not library.dll.config.
If you are using VSTO 4 SP1, then you may be running into a problem described in this blog: http://msdnrss.thecoderblogs.com/2011/06/vsto-4-0-sp1-will-cause-a-vsto-addin-to-not-find-its-config-file/ The solution is to change your registry values for your office addin from:
Manifest=”C:\Program Files\<Path>\WordAddIn.vsto|vstolocal”
to:
Manifest=”file:///C:\Program Files\<Path>\WordAddIn.vsto|vstolocal“