Reputation: 1533
I am using VS 2012.
I add services reference to my WPF project, but when I've changed my services and updated service reference my Reference.svcmap -> Reference.CS file will be blank and I can't use reference anymore. I can see it in project, but I can't use.
My settings of Services References are :-
Reference.cs file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
Upvotes: 25
Views: 41646
Reputation: 63065
There are few things you can do first Clean the solution, delete the output directory and the service reference. Restart the Visual Studio and re configure the web service.
Upvotes: 1
Reputation: 81
It can be caused by Team Foundation source control. Try to right click on the service ref and choose "Check out for edit..." Than update service reference again.
Upvotes: 0
Reputation: 73
While configuring service reference append /mex (address of your end point with mexHttpBinding ) at the end of your service URL.
This will enable metadata exchange. So Reference.cs will be modified / added (if you are adding service reference for the first time).
Edit : On analysis I found that this issue happens when a service (which implements one ServiceContract) is exposed via more than one end point.
This issue can be avoided by using different Service Contracts (Interface) for each end point and making the service class (service1) implement all these Interfaces.
Upvotes: 4
Reputation: 935
uncheck the Reuse types in referenced assemblies checkbox and put address of your new service in Address textbox.
Upvotes: 30
Reputation: 6943
If you cannot browse the URL, then you will not be able to add the service reference. Try hosting your web service locally in IIS. When you're able to browse the URL, then you can add the service reference.
Upvotes: 3