I am using visual studio 2010, my application has a multiu layer architect,
MainUI, WCFService, BLL and DAL
My MainUI communicated to WCF and WCF further communicates to BLL and DAL, whenever i need to debug BLL and DAL, i first need to attach WCF as a process in Visual studio(everytime). How could i can save myself from this hassle.
How could i set up visual studio in a way that i automatically attach to the service automatically and i could debug my application easily.
Thanks
If I understand correctly, Macro may be answer:
in Vs:
Sample howto start a process and attach it to Visual Studio 2010 with EnvDTE(Version is relevant).
Here is a detained article that explains how to do this...You can customize this macro.
http://sivablogz.wordpress.com/2013/04/08/running-an-application-and-attaching-to-the-process-with-a-macro-in-visual-studio/
Personally I prefer to use Debugger.Launch() as suggested here in this thread, because it doesn't need for references to the DTE (that's IDE-specific and must be explicitly referenced into the project to be used)
Configure your solution for multi project start up. I do this for a similar application. VS launches the WCF and client automatically and I can set break points in either.
The start-up order is the order in which you select the projects.
Right mouse click on your solution and select 'choose startup projects'. Then select multiple startup projects and select the projects.
Have you tried using the WCFSvcHost.EXE that comes with Visual Studio to launch the BLL and DAL service? There is a help file with it. The help file states it best, "Windows Communication Foundation (WCF) Service Host (wcfSvcHost.exe) allows you to launch the Visual Studio debugger (F5) to automatically host and test a service you have implemented. You can then test the service using WCF Test Client (wcfTestClient.exe), or your own client, to find and fix any potential errors." The default installation is C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE. You can configure it to use your MainUI app as the client. The help file WcfSvcHost.chm in the same directory has a section for using a custom client under the Scenarios for using ECF Service Host. If you rather here is the link to help on MS web site: Using WCF Service Host (wcfSvcHost.exe).