WCF Service, the type provided as the service attribute values…could not be found

后端 未结 14 1170
梦如初夏
梦如初夏 2020-12-24 11:44

When I right click on Eval.svc within Visual Studio 2012 and view in browser, I get the following -

The type \'EvalServiceLibary.Eval\',

相关标签:
14条回答
  • 2020-12-24 12:29

    I had the same problem. Make sure you include assembly name in Factory property in your .svc file. Maybe you need to clean IIS cache if you had renamed project assembly name.

    0 讨论(0)
  • 2020-12-24 12:30

    This is an old bug, but I encountered it today on a web service which had barely been altered since being created via "New \ Project.."

    For me, this issue was caused by the "IService.cs" file containing the following:

    <%@ ServiceHost Language="C#" Debug="true" Service="JSONWebService.Service1.svc" CodeBehind="Service1.svc.cs" %>
    

    Notice the value in the Service attribute contains ".svc" at the end.

    This shouldn't be there.

    Removing those 4 characters resolved this issue.

    <%@ ServiceHost Language="C#" Debug="true" Service="JSONWebService.Service1" CodeBehind="Service1.svc.cs" %>
    

    Note that you need to open this file from outside of Visual Studio.

    Visual Studio shows one file, Service1.cs in the Solution Explorer, but that only lets you alter Service1.svc.cs, not the Service1.svc file.

    0 讨论(0)
提交回复
热议问题