简体   繁体   中英

Visual Studio 2008 debugger keeps detaching

I'm trying to debug some code ie 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, and I cannot fix it. Is it an IIS issue or Visual Studio?

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.

最近,我遇到了这个问题与调试,同时运行Internet Explorer 8的多个实例,这会是你的问题?

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?

I found this was due to incompatibility with debugging between 64 bit and 32 bit. I forced visual studio to debug in 32 bit and this seemed to resolve my issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM