How to: Enable CLR Debugging For a Connection
This topic applies to:
Edition |
Visual Basic |
C# |
C++ |
Web Developer |
---|---|---|---|---|
Express |
||||
Standard |
||||
Pro and Team |
Table legend:
Applies |
|
Does not apply |
|
Command or commands hidden by default. |
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.
Note
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.
Note
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.
Note
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
Open Server Explorer.
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.
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.
Click Yes to enable debugging.