Question: How can I debug a WCF service – I can’t hit the breakpoint inside the service
Using VS2012 and NUnit/TestDriven
I can run my test fine, as long as I’ve started the service before eg Ctrl F5 on the WcfHostApplication. Am hosting inside Visual Studio.
Have tried putting in a Web.Config into the WcfHostConsoleApplication and setting debug to true.

This sample app came from here
//hack to get working as we're not using wsdl yet...mimicking what happens in wsdl
[ServiceContract(Namespace = "http://www.programgood.net/examples/2012/09/wcf")]
public interface IHelloWcfService
{
[OperationContract]
string SayHello(string msg);
}
namespace HelloWcfTests
{
[TestFixture]
public class HelloWcfServiceLibrary_Tests
{
[Test]
public void SayHello_GivenHello_ShouldReturn()
{
//in reality add Service Ref.. using another special interface called IMetaDataExchange
IHelloWcfService proxy = ChannelFactory<IHelloWcfService>.CreateChannel(
new NetTcpBinding(),
new EndpointAddress("net.tcp://localhost:9000/HelloWcfEndPoint"));
string msg = "hello";
string result = proxy.SayHello(msg);
StringAssert.StartsWith("You entered: hello", result);
}
}
}
Do not start your service with Ctrl+F5 because it will start your service without debug.
Start it with F5.