I have a .net project that has a web reference to a service. I would like to update that web reference as part of every build. Is that possible?
Also, when you are deploying your webservices on production make sure that they are set as Dynamic and not static.
You can use svcutil (http://msdn.microsoft.com/en-us/library/aa347733.aspx) tool to generate the web reference for you. The tool will generate the proper client proxy classes and the proper config (and it can even merge it in your application config). Keep in mind that the tool requires .Net 3.0 and will generate WCF-style client proxies and configuration.
You can use MSBuild script with a task that calls wsdl.exe
<Target Name="UpdateWebReference">
<Message Text="Updating Web Reference..."/>
<Exec Command="wsdl.exe /o "e;$(OutDir)"e; /n "e;$(WebServiceNamespace)"e; "e$(PathToWebServiceURL)"e;"/>
</Target>
You can do it using the methods provided by the other answerers, but you have to know that doing this could cause your build to fail. If the WSDL was changed, the generated code is also going to change and your code may no longer compile.
Vivek's answer was correct. I did not specify that I needed unmanaged c++ code for the proxy. For that I had to use sproxy.exe instead of wsdl.exe.