I have created a class library as a project. Where I have added a service reference, which reference is a .svc ( its called OData Service what I am using)
I have created a class that exposes methods and uses this reference to get data.
All is working fine.
Now my doubt is, If I say want to change the url of the service reference, do I have to go open my visual studio solution, then remove old reference then add again with the new reference ?
I now there has to be a better way using config or something, there should be an app.config created whenever I add a reference right ?
This is not happening in my case.
The service reference you created generates code which works against a specific service model. Any service with the same model can be used at runtime with it. The URL of the actual service used at the runtime is passed as an argument to the constructor of the DataServiceContext (the generated code includes a class which derives from this one). There's no app.config generated for this.
You can definitely use app.config and load the URL from it in your code and pass it to the DataServiceContext constructor. But you will have to write this code yourself.