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

后端 未结 14 1169
梦如初夏
梦如初夏 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:06

    Ensure that binary files are under "bin" subdirectory of your ".svc" file

    0 讨论(0)
  • 2020-12-24 12:08
    1. When you create an IIS application only the /bin or /App_Code folder is in the root directory of the IIS app. So just remember put all the code in the root /bin or /App_code directory (see http://blogs.msdn.com/b/chrsmith/archive/2006/08/10/wcf-service-nesting-in-iis.aspx).

    2. Make sure that the service name and the contract contain full name(e.g namespace.ClassName), and the service name and interface is the same as the name attribute of the service tag and contract of endpoint in web.config.

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

    I just hit this issue myself, and neither this nor any of the other answers on the net solved my issue. For me it was a strange one whereby the virtual directory had been created on a different branch in another source control server (basically, we upgraded from TFS 2010 to 2013) and the solution somehow remembered it's mapping.

    Anyway, I clicked the "Create Virtual Directory" button again, in the Properties of the Service project. It gave me a message about being mapped to a different folder and would I like to update it. I clicked yes, and that fixed the issue.

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

    Double check projects .net versions. Projects that referenced each other with different .net versions causes problems.

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

    Right click on the .svc file in Solution Explorer and click View Markup

     <%@ ServiceHost Language="C#" Debug="true" 
         Service="MyService.**GetHistoryInfo**" 
         CodeBehind="GetHistoryInfo.svc.cs" %>
    

    Update the service reference where you are referring to.

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

    Change the following line in your Eval.svc file from:

    <%@ ServiceHost Language="C#" Debug="true" Service="EvalServiceLibary.Eval" %> 
    

    to:

    <%@ ServiceHost Language="C#" Debug="true" Service="EvalServiceLibary.EvalService" %>
    
    0 讨论(0)
提交回复
热议问题