I have inherited a .NET 4 VS2010 solution consisting of a WinForms app and a web service. I don’t have access to a server that’s running a copy of the web service but I have to run, debug, upgrade and test the project that accesses the web service as well as the web service code.
Later, I also want to quickly switch between a deployed web service and the code in my local project
What’s the best strategy for changing the projects so I can make changes to both projects, test locally, deploy the web service then test against that? If I find issues, I want to switch back to “local” mode to debug.
Thanks team!
The easiest is to host the service locally in visual studio and change the service url to switch between the production service and the local one. You can automatically switch between the services by checking for Debug and Release modes using
#ifand#elsedirectives.You can also use the interface to provide a stub of the service. This will also make unit testing easier.