This article has been archived. It is offered "as is" and will no longer be updated.
Bug #: 408396 (SQLBUDT)
When you use performance tools in Microsoft Visual Studio Team Edition for Software Developers to profile managed code that is running in Microsoft SQL Server 2005, the information about SQL Server integration with the Microsoft .NET Framework common language runtime (CLR) module is represented incorrectly.
For example, if you try to profile managed code of a user-defined function in SQL Server 2005, you may notice that the name of the user-defined function is incorrectly represented as LRStubOrUnknownAddress. Additionally, if you develop your own tool by using the CLR Profiling API, the tool may not work correctly.
This problem occurs because the module load event is not generated with the CLR that is being hosted within the SQL Server process.
If you want to profile some part of your managed code, follow these steps:
Use Visual Studio 2005 to create a separate project that is not a SQL Server project.
Profile the separate project.
Integrate the separate project into a SQL Server project. Note that the code that you profile cannot reference any SQL Server objects, such as the SqlContext object.
Microsoft SQL Server 2005 Standard Edition, Microsoft SQL Server 2005 Developer Edition, Microsoft SQL Server 2005 Enterprise Edition, Microsoft SQL Server 2005 Express Edition, Microsoft SQL Server 2005 Workgroup Edition, Microsoft Visual Studio 2005 Team System Developer Edition