I am have a simple hosting WCF service side-by-side with ASP.NET and have a difficult time to debug/step-in to the service. Below are the files. Thanks in advance!
Web.config
<system.web>
<compilation debug="true" targetFramework="4.5.2"/>
<httpRuntime targetFramework="4.5.2"/>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="mexBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name="WCF_TestService.TestService" behaviorConfiguration="mexBehavior">
<endpoint address="" binding="basicHttpBinding" contract="WCF_TestService.ITestService"></endpoint>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080/" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
ITestService.cs
namespace WCF_TestService
{
[ServiceContract]
public interface ITestService
{
[OperationContract]
string GetMessage(string name);
}
}
TestService.svc.cs
The breakpoint is set on return
and the prompted message is The breakpoint will not currently be hit. No symbols have been loaded for this document
namespace WCF_TestService
{
public class TestService : ITestService
{
public string GetMessage(string name)
{
return $"Hello {name}";
}
}
}
Client
The client is the console application.
namespace Client
{
class Program
{
static void Main(string[] args)
{
ServiceProxy.TestServiceClient client = new ServiceProxy.TestServiceClient();
Console.WriteLine(client.GetMessage("John Smith"));
Console.ReadLine();
}
}
}