Last post Jul 29, 2013 12:18 AM by Amy Peng - MSFT
Jul 23, 2013 01:58 AM|brijeshvaidya|LINK
i have class library project where i add the app.config file and give this class lib. project reference (as dll) to the wcf service.
when i add app.config in wcf and add key in it and then access in wcf via
string messagepath = ConfigurationManager.AppSettings["MessagePath"].ToString();
then my wcf is not working
but when i pass hard coded path, it is working
i got following error:
Failed to invoke the service. Possible causes: The service is offline or inaccessible; the client-side configuration does not match the proxy; the existing proxy is invalid. Refer to the stack trace for more detail. You can try to recover by starting a new
proxy, restoring to default configuration, or refreshing the service.
if i Add this:
string messagepath = "D:\\Projects\\Messages";
and Comment this:
// string messagepath = ConfigurationManager.AppSettings["MessagePath"].ToString();
The wcf service is working fine.
Jul 23, 2013 02:15 AM|brijeshvaidya|LINK
it is resolved by applying the same key path into the web.config file of the WCF service.
<add key="MessagePath" value="D:\Projects\Messages"/>
Jul 29, 2013 12:18 AM|Amy Peng - MSFT|LINK
I am very glad that you have solved your problem by yourself.
If you have any other problem, welcome to post it in the asp.net forums.
Best Regards, Amy Peng