How to make the application read the application configuration instead of machine.config?

I have the word add in an application created in C # that accesses a web service and works fine if it is installed outside the Program Files folder. it is strange that when I install this in the Program Files folder, the client does not read the configuration in [application] .dll.config and raises an error, as shown below:

"The default endpoint element could not be found in the link contract [..] in the ServiceModel client configuration section. This may be because the configuration file was not found for your application or because no endpoint element matched this contract was not found in the client. "

I read this article and it seems that it does not solve my problem. Could not find default endpoint element

I am using windows7 btw and have not tested it on another OS.

Update: After reading the above link, I tried moving the configuration to machine.config, and it works, but how to get the application to read the application configuration instead of machine.config?

+5
source share
3 answers

If you are using VSTO 4 SP1, you may have the 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 the registry values ​​for your office application:

Manifest="C:\Program Files\<Path>\WordAddIn.vsto|vstolocal"  

at

Manifest="file:///C:\Program Files\<Path>\WordAddIn.vsto|vstolocal" 
+12

.config , , , , .

App , , .

Program Files, config ? " "?

0

.dll app.exe, app.exe.config, library.dll.config.

0
source

All Articles