Ben2307
Ben2307

Reputation: 1022

error while renaming WCF service

I created a WCF service (the regular templete one) and tried to access the service. after that everything was fine. after i renamed (using refactoring the name of IService and Service) OSDataService and IOSDataService i got the following error while accessing the srv file : enter image description here

how can i rename it without getting this error? i tried also changing it in the web.config file and still the same problem. Anybody had this problem?

Upvotes: 3

Views: 2587

Answers (4)

Ben2307
Ben2307

Reputation: 1022

Well solved it: you need first to rename the Iservice on the solution explorer, then refactor the service and refactor again all the data (VS2010 will tell you what to do) only then rename the service name (on the solution explorer)

Upvotes: 1

Vladimir
Vladimir

Reputation: 3689

You must update the reference in the client. Or update the stubs manually, but I wouldn't recommend that.

Upvotes: 0

Tomas Jansson
Tomas Jansson

Reputation: 23472

Do you have a .svc-file? Have you updated the markup in that file if you have one?

Do a search in the whole solution after the old service name and you will moste likely find the file that need to be updated.

Upvotes: 1

Samir Adel
Samir Adel

Reputation: 2499

You have to view the markup of the service file and change this in the directive to be the new name because it doesn't change automatically

Right click on the service name, then chose "view markup" and then change the "Class" attribute to be the new name.

Upvotes: 9

Related Questions