Visual Studio 2005 and Web References

Visual Studio 2005 no doubt, has been a much better version of the studio, targetting .NET Framework 2.0

When we develop Web Application and Web Services, we create both the application and web service in our local machine and hence the URL
http://localhost/WebService1/Service1.asmx would work very well in our local environment.

However, when you move your application to Testing or Production machine, the Web Service will reside on a different machine (atleast that is the purpose of using a Web Service, other than platform independence). Hence, you may require to update the Web reference URL in this scenario.

While in Visual Studio .NET 2003/2002, when you add a Web Reference, a Proxy Class is also added and you can see the code that is generated, in Visual Studio 2005, only the Disco file, Discovery file and WSDL files are added when you add a Web Reference.

The App_WebReferences folder is new in Visual Studio 2005 and whats more new is that the Web Reference URLs are by default dynamic.

In Visual Studio .NET 2003 (and earlier versions), we need to mark the Web Reference URL's URL Behaviour property to dynamic, to ensure that the URL is configurable when you deploy your application. The default property is static. So, if you leave it as such, it may lead to hardcoded Web Reference URL in the proxy classes as well as WSDL.

However, in Visual Studio 2005, the default property is dynamic. The moment you add a web reference to your application, a Key value pair is added under the App Key Settings of your web.config. Needless to mention, the key is nothing but the WebReferenceName.WebServiceName and the value is the URL for the Web Service.

This makes our job simple since after deployment, we just need to change the URL in the Web.Config file and it reflects for all the Web Reference files (disco, discomap and WSDL) created for each Web Reference.

This can be very handy in deployment situations and I really found it worth sharing..

Cheers and Happy Programming !!!

Microsoft Blogstars Contest - Blog to win !!!

Well, I have been quite for a long time here in community news. But now, I have an exciting information to share.

Microsoft has announced the
Microsoft Blogstar Contest a contest to identify the best Developer bloggers in India.

This is an exciting contest since, you could become a Blogstar over a fortnight and what is cool is that you just have to submit your Blog URL to enrol for this contest. Even if you are a new Blogger, you still qualify for the contest since quantity of posts doesnt matter.

It is an initiative to identify the Passion for the community and I am sure, it would benefit the community at a greater level.

For registration and more information, check
Microsoft Blogstar Contest

Cheers and Best wishes for winning the contest !!!

«October»
SunMonTueWedThuFriSat
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234