Suppose there is a WCF service project that uses the Entity Framework.

I want to compile this service as a library and build on WinService.

There are several questions:

1) Will the WCF service library use its own .config or already a .config WinService?

2) Can libraries be debugged only through the connection to the process?

  • I think if both projects will lie in one solution, then you can debug dll. And configs can be customized. You can use one config for wcf and win service, but you can be different. And how should you? - Atlantis
  • One. Config WinService. - iluxa1810
  • Then just add to the project with WCF a link to the config win service. Like this msdn.microsoft.com/dynimg/IC625712.png - Atlantis

1 answer 1

  1. Yes, settings from the service config file will be used. Standard configs in .net work at the application level, and not at the level of individual dlls.
  2. If you need to debug the start of the service, you can add a call to Debugger.Launch .

Or set the studio as a debugger for the exe-file of the service via Image File Execution Options - but this will still launch a new studio, and not just turn on debugging into an existing one.

But these methods should be used only for debugging problems related specifically to the Windows Service, and not to the WCF that is hosted in it.

The work of the WCF host inside the service is no different from the operation of the WCF host inside a regular console. So the easiest way to debug a WCF service in the development process is to create a separate console application to run a WCF host from the studio, with a config that is common between the service and the console application.