User-1835425756 posted
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.