I recently decided to migrate existing asmx services to WCF. Now I have created a new solution that contains the WCF services library (it will eventually be a link to the WCF website).
My old code was heavily based on HTTPContext, but my understanding of this defeats the WCF Services point, which by its nature can be launched from any context, whether it be something from a console application into the MS Outlook plugin (fine, a bit extreme, but you get the idea).
Before I set my configuration in web.config, now I still save my configuration there, or more, to the WCF Libraries App.Config service.
Does the WCF website now have a more general way of referencing paths, not HTTPContext, but the application implementation path, so that I can write code once that works anywhere? (Note: In the past, the bin directory was in the asmx application startup path).
So, to summarize the following questions here:
- Where is the best place to store configuration values in the web.config of the WCF website or in the app.config of the WCF service library?
- How can I avoid using HTTPContext for relative file locations and implement a more general approach to better take advantage of WCF services running anywhere.
source
share