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 :
how can i r开发者_JAVA技巧ename it without getting this error? i tried also changing it in the web.config file and still the same problem. Anybody had this problem?
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.
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.
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)
You must update the reference in the client. Or update the stubs manually, but I wouldn't recommend that.
精彩评论