将service1.svc文件重命名为someNameService.svc后,wcf服务将不会运行

时间:2015-10-01 13:07:41

标签: .net wcf invalidoperationexception

创建了一个新的wcf服务项目。将service1两个文件重命名为newName.svc和类名。 现在当我运行它时,它在配置元素的Service属性中显示“无法找到类型namespace.service1” system.serviceModel / serviceHostingEnvironment / serviceActivations。 web.config中没有这样的属性。那么它在哪里以及如何改变呢?

2 个答案:

答案 0 :(得分:2)

通过Google搜索,我发现了这一点:solution 我看到类似的问题都指定了IIS的不同版本,它实际上只是使用Xml(文本)编辑器使用右键单击Visual Studio中的Open With ..选项打开svc文件。 Service属性的值不正确。随意投票,因为我可以真正使用代表

答案 1 :(得分:1)

根据您提供的信息,修复程序将是这样的:

<system.serviceModel>
    <services>
      <service name="YourProject.Project.YourService" behaviorConfiguration="">
        <endpoint address ="" binding="" contract="YourProject.Project.IYourService" behaviorConfiguration="">
        </endpoint>
      </service>
    </services>

合约是您所拥有的服务的接口, newName.svc

相关问题