WCF Error Message: unable to automatically debug some.dll. The remote procedure could not be debugged. This usually indicates that debugging has not been enabled on the server.

I recently received this message, and it took me a little while to recall that joke about how a software engineer suggests that everyone steps out of the car and steps back in after it has not been starting.

This message does occur somewhat legitimately in a couple of situations:

  1. when app.config (or web.config) does not have ‘debug’ set to true:
<system.web>
   <compilation debug="true" />
</system.web>  
  • when you have multiple hosts in a project, and you are debugging via a host whose app.config does not have debug set to ‘true’. When your service is a DLL, and hosted in WCF Service Host for the purposes of debugging, the DLL’s app.config file is used. If, however, you are debugging in a different container, you need to remember to duplicate DLL’s app config settings in the hosts config file.

  • Another time you may see “unable to automatically debug”, although the rest of the message differs slightly, is when you change the projects output paths from the standard bin/Debug, and the WcfHost can’t seem to handle a different working directory. You’ll get a message and won’t be able to step into the library code – more on that later.

Finally, closing the Studio, and re-opening it again can also solve the problem!