When you try to debug a solution in Visual Studio, you may get an error “Unable to attach. The binding handle is invalid”. This error does not stop you from running the solution, but it will not allow you to debug the code and none of breakpoints will stop the code execution. A kind of annoying situation for developers.
Visual Studio shows this error message when the Windows Service Terminal Services is disabled or stopped. To resolve the issue all you need to do is to start the Windows Service and to avoid the same problem in future ,set start-up type of the service to Automatic. You can start the services by following these instructions
- Open Run Command box by pressing Windows + R keys.
- Execute the command Services.msc. Opens up Windows Services window.
- Search for the service “Terminal Services” and start the service
- Also set start up type to Automatic
I tested this solution on Windows XP with Visual Studio 2005 and worked fine. Hope this helps you.