Why does my Visual Studio 2005 detach from the process when I start the debugger?

I’m using VS2005 to develop a web application. When I start debugging it will open the web page but the immediately detach from the process. I have found that if I close the IDE and start it back up it will work fine for a while but then start detaching again. Any insight into this odd behaviour would be greatly appreciated.