When I right click on Eval.svc
within Visual Studio 2012 and view in browser, I get the following -
The type \'EvalServiceLibary.Eval\',
Ensure that binary files are under "bin" subdirectory of your ".svc" file
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).
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.
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.
Double check projects .net versions. Projects that referenced each other with different .net versions causes problems.
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.
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" %>