Geeks With Blogs

News My Blog has been MOVED to https://mfreidge.wordpress.com
Michael Freidgeim's OLD Blog My Blog has been MOVED to https://mfreidge.wordpress.com

I have a class library DLL, that has client web services reference. The reference is dynamic and in generated app.config the URL is listed inside <applicationSettings>.
I am using the class from web Application(WAP) and by copying <..Properties.Settings> to web.config I am able to change the URL just by modifying value in web.config(I even wrote helper class to Update Dynamic Web reference URLs Diring Installation in Visual Studio 2005). The approach is well described in
How to share dynamic URLs across multiple Web Application Projects  post.

I recently tried to call the same client web services class from windows console application. I copied the same section <..Properties.Settings> to console's app.config, but URL, specified in config file, is ignored, and application uses default hardcoded value.

I tried a few things without success. The troubleshooting is very annoying because  if the corresponding setting in config file not found, .Net infrastructure doesn't report any warning, but just uses default vaue.  I ended up by writing extra code to read URL from app.settings and explicitely assign URL to web service with the code similar to the following:

service.Url = ConfigurationSettings.AppSettings["WebServiceUrl"];

It seems that other peoople also sometimes have problems  in setting dynamic URL(for example see Dynamic URL Behavior & Configuration  thread).

Posted on Monday, September 10, 2007 9:05 PM Web Services/WCF | Back to top


Comments on this post: Dynamic URL Web Service URL is not loaded from applicationSettings section in Console application

# re: Dynamic URL Web Service URL is not loaded from applicationSettings section in Console application
Requesting Gravatar...
I can not find the url property of the web service.
Left by shalom on Dec 10, 2007 7:23 PM

# re: Dynamic URL Web Service URL is not loaded from applicationSettings section in Console application
Requesting Gravatar...
Left by Michael Freidgeim on Dec 11, 2007 1:26 AM

Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net