This documentation is archived and is not being maintained.

How to: Enable CLR Debugging For a Connection

This topic applies to:

Visual Studio Edition

Visual Basic

C#

C++

J#

Visual Web Developer

Express

No

No

No

No

No

Standard

No

No

No

No

No

Pro/Team

Yes

Yes

Yes

No

No

This topic describes how to enable SQL CLR debugging for a SQL Server 2005 database connection. These steps are not needed if you are only debugging T-SQL database objects.

To debug multi-tier database applications, you must have enabled debugging for the project. For further information, see How to: Enable SQL Debugging For a Project. You must also have enabled Application debugging for the selected database connection. For more information, see How to: Enable Multi-tier Debugging.

NoteNote

You must also enable the running of CLR assemblies on the SQL Server. For more information look up clr enabled Option in the SQL Server 2005 Books Online.

NoteNote

Once you have started debugging, it is too late to change settings in Server Explorer. Changes made in Server Explorer will not take effect until the start of the next debugging session.

NoteNote

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

Enable SQL/CLR Debugging

  1. Open Server Explorer.

  2. In Server Explorer, right-click on the connection you want to debug and choose Allow SQL CLR Debugging. This setting enables SQL CLR debugging for all connections on the server.

  3. A message box appears with the warning: "SQL CLR debugging will cause all managed threads on the server to stop. Do you want to continue?". When you are debugging SQL CLR database objects, breaking execution will break all threads on the server, affecting other users. For this reason, you should not debug SQL CLR applications on a production server.

  4. Click Yes to enable debugging.

See Also

Show: