Setting "URL Behaviour" to "Dynamic" has no effect

H

Hans Malherbe

Greetings

When I set the "URL Behaviour" of a web reference an entry is created
in the "Web.config", but the value in the "Web Reference URL" property
is still used.

When I look in the file "Reference.cs" I can see that "this.Url" is set
in the
constructor of the reference class to the hard coded value in the "Web
Reference URL". If I change this line in the generated code to read:

this.Url = ConfigurationSettings.AppSettings["Whatever.x"];

it takes the configured value and everything works. The only problem is
that "Update Web Reference" restores this to the original value.

Is there a sane way around this. I would like to have the dynamic
reference take the URL from the "Web.Config" and not change when I
update the web reference.

Thanks in advance
Hans
 
H

Hans Malherbe

Solved.

It seems that if the name of the web reference contains the word
"Static" the file "Reference.cs" will not get updated when you change
the behaviour from static to dynamic.

Groete
Hans
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top