Recently I made the decision to port my existing asmx services to WCF. I have now created a new solution which contains a WCF Service Library (this will eventually be referenced from a WCF Web site).
My old code relied heavily on HTTPContext, but its my understanding this defeats the point of WCF Services which by nature can run from any context, be that anything from a console app to an MS Outlook plugin (ok a bit extreme, but you get the idea).
Before I had my configuration in web.config, do I now still keep my configuration there, or more it to the WCF service Libraries App.Config.
With a WCF Web Site, is there now a more generic way to reference paths, not based on HTTPContext, but App Execution path, so that I can write code once that will run anywhere? (Note: In the past in asmx app execution path was bin directory).
So to summarize here are the questions:
- Where is the best place to store configuration values, in the web.config of WCF web site or in the app.config of the WCF service library?
- How can I get away from using HTTPContext for relative location of files, and implement a more generic approach, so to better take advantage of having the WCF services run anywhere.