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.