At an appropriate point in your code you add:
if ( !System.Diagnostics.Debugger.IsAttached )
{
System.Diagnostics.Debugger.Launch();
System.Diagnostics.Debugger.Break();
}
It will search for a suitable debugger which would include the IDE that you have open on your code.