简体   繁体   English

重命名IIS上托管的WCF服务

[英]Renaming a WCF service hosted on IIS

I have renamed a WCF service and everything works just fine on my test/development environment. 我已经重命名了一个WCF服务,在我的测试/开发环境中一切正常。 However, the service is not accessible on my production environment, which is IIS. 但是,我的生产环境(IIS)无法访问该服务。 When trying to access the service the client receives roughly the following error: 尝试访问该服务时,客户端大致收到以下错误:

The request failed with the error: The type Old_Service_Name.Some_Type could not be found. 请求失败并显示错误:找不到类型Old_Service_Name.Some_Type。

In other words, IIS should be informed about the renaming of the service. 换句话说,应该告知IIS重命名服务。 How do I tell IIS, preferably using IIS Manager, that the service has a new name? 如何告诉IIS,最好使用IIS管理器,该服务有一个新名称?

In the service.svc file, change the Service attribute of the ServiceHost tag so that it suits your new service name. 在service.svc文件中,更改ServiceHost标记的Service属性,使其适合您的新服务名称。 Namely, replace Old_Service_Name.Some_Type with New_Service_Name.Some_Type . 即,将Old_Service_Name.Some_Type替换为New_Service_Name.Some_Type

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM