UrlBehavior

by Sander Gerz November 20, 2003 09:43

Here's something I found out today. Sure, it's been sitting in the helpfile, but I never saw it. There a property you can set with a webreference called UrlBehavior. The value of this property determines whether the URL of a Web reference is hard-coded into the generated Visual Basic or Visual C# proxy code.

When set to webrefUrlBehaviorDynamic, you can set the url of the webservice in the app.config file like this.

<configuration>
   <appSettings><add key="SomeProject.localhost.Service1"
      value="
http://localhost/SomeWebService/Service1.asmx"/>
   </appSettings>
</configuration>

No need to recompile your app. You learn something everyday.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Comments

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen | Modified by Mooglegiant