Mahesh Yadav
asked on
how to add a config file in visual studio sql server project
I have created a sql server project in visual studio 2005 (C#).
in this project I have added a web Reference to a web service.
Now I need to figure our one way by which I can change service URL without recompiling the project and then regenerate the dlls.
some thing like adding the URL in config file
in this project I have added a web Reference to a web service.
Now I need to figure our one way by which I can change service URL without recompiling the project and then regenerate the dlls.
some thing like adding the URL in config file
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can right click your project in Visual Studio > Add New Item > Config File
It will automatically create a config file for you and then you add the necessary values.
It will automatically create a config file for you and then you add the necessary values.
So as long it is the SAME soap you can program it to change by doing this.
APIref.PSAPIService apiService = new APIref.PSAPIService ();
apiService.Url = <url>
APIRef is the alias name of the web service you added.
PSAPIService is the name that the web service is called
then assign the url.
Again to be clear the SOAP calls need to be identical otherwise it can produce errors.
We needed to do this so we could easily go from unit testing to qa testing to production servers with out a recompile.
Hope this helps.