views:

35

answers:

3

Hello i'm trying to debug some code i.e. trying to get the values of some parameters

 public SqlDataReader GetAllCompaniesByType(int type)
    {
        SqlParameter[] sqlp = new SqlParameter[2];

        sqlp[0] = new SqlParameter("@CompanyTypeID", type);
        sqlp[1] = new SqlParameter("@AreaID", DBNull.Value);

        try
        {
            return SqlHelper.ExecuteReader(Settings.GetConnectionString(), CommandType.StoredProcedure, "procExtCompaniesByCompanyTypeIDSelect", sqlp);
        }
        catch (SqlException sqlEx)
        {
            ErrorReporting.WriteExceptionToLog(Settings.GetErrorLog(), sqlEx);
            return null;
        }
    }

but for some reason the debugger keeps detaching. It is not just this code but happening everywhere it is driving me INSANE... does anyone know how to fix this??? Is it an IIS issue or vis studio??? Please help!

A: 

If the debugger detatches at random it is generally because the process it is atatched to has terminated. Just a wild guesss but a common thing to cause a process to end without throwing an exception that is caught in the debugger is a stack overflow. Does it detatch on the same line of code repeatedly or does it do it at random? If it is at random then maybe there is some issue with the machine you are debugging on, try debugging on a different PC see if you get the same issue.

Ben Robinson
it's happening at random... i don't have a different machine available with vis studio etc...
jeff
Is the machine low on memory or is there some kind of memory leak. This could be caused by the IIS application pool recycling frequently. Check you windows event log see if iis is creatingfrequent app log entries saying that it is recycling the application pool.
Ben Robinson
not seeing anything in the event log just tested again...
jeff
The debugger randomly detaching is usually the process you are debugging terminating. If it is a website then this is the iis/asp.net worker process. Is the website running in IIS on this machine or is it running in the built in VisualStudio web server. If it is IIS then try changing it to use the built in visual studio web server and see if that helps, at least you will be able to tell if the process is terminating because you get orphan icons in your sys tray,
Ben Robinson
it's running on the internal web server (i'm just clicking start debugging) it runs, builds fine, opens IE window and I can attach step in to code etc. but as soon as I leave it standing it just seems to detach...
jeff
I have only ever seen the debugger detatch itself when the process being debugged is terminated, can you confirm whether this is happeneing i.e. is the VS internal web server still running after the debugger detatches?
Ben Robinson
A: 

I recently ran into this issue with debugging while running multiple instances of Internet Explorer 8. Could this be your problem?

Garett
i only have one instance of IE 8 open (which i use for running web apps) my normal browsing is all done through chrome.
jeff
A: 

Try cleaning your solution & clearing out all the asp.net temporary files.

you may find the temp files here C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files.

Check your modules view are symbols being loaded?

John Nolan
yea symbols are loading, when you click start debugging button and it says (running) after awhile it just stops and doesn't say (running) anymore like it's detaching.
jeff
dumped all my temp files, this is still happening, don't know what to do...
jeff