Attaching to the service should work, so I'm not sure why you can't. In lieu of that, insert the following line in the application entry point for your Windows service (or the OnStart() method), compile in debug mode, and start the service.
System.Diagnostics.Debugger.Break();
When you start the service, you will be prompted to debug the process. Select the Visual Studio 2008 debugger, and the process will load and stop at your programmatic breakpoint. Hit F5 to start running again.
EDIT:
Let's say that you've built the service (release mode or debug mode - it doesn't matter) and used installutil to install the service, but you haven't started it yet. As long as the service is not running, you can continue to make code changes and re-compile. When you start the service, your service will reflect your latest code changes. If the service is running, you will not be able to fully compile the service because the exe/dll(s) are in use and cannot be replaced. Obviously, simply stop the service, re-compile, and then re-start the service. The point is this: You do not have to uninstall the service in order to modify the code. Just stop it, change the code, re-compile, and re-start.
As for debugging in debug vs. release mode, I don't know if that's why you can't attach to the process. I do know that it is possible to debug release versions, but I would not recommend this simply because if optimizations are turned on, you may run into issues traversing the code. We've only used release-mode debugging as a last resort.
By default, when you build a Visual Studio application in debug mode, it is put in a bin\Debug subdirectory of your project. When you build in release mode, the executable is put in a bin\Release subdirectory. When you use installutil to install your service, the only thing that matters is where the service resides. In your case, I would suggest un-installing the release-mode version of your service (installutil /u c:\myapp\myapp\bin\release\myapp.exe
), putting the programmatic breakpoint in, building the debug version, and then using installutil to install the debug version (from the bin\Debug directory).
Sorry this was long-winded. I hope that's clear.