You cannot debug assemblies that are referenced in the Script task code by using Visual Studio for Applications in SSIS (922647)



The information in this article applies to:

  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Workgroup
  • Microsoft SQL Server 2005 Enterprise Edition for Itanium Based Systems
  • Microsoft SQL Server 2005 Enterprise X64 Edition
  • SQL Server 2005 Standard Edition for Itanium-based Systems

INTRODUCTION

Consider the following scenario. You are debugging a Script task in an SSIS package in Microsoft Visual Studio for Applications. You try to step into an assembly that is referenced in the code of the Script task. In this scenario, you receive the following message:
There is no source code available for the current location.
You can click Show Disassembly to view the assembly of the referenced library. However, you cannot debug the assembly.

In Microsoft SQL Server 2005 Integration Services (SSIS), you cannot debug assemblies that are referenced in the Script task code by using Visual Studio for Applications. This problem occurs even if the assembly is loaded in the global assembly cache. This article introduces a method that you can use to debug the assemblies that are referenced in an SSIS Script task by using a separate instance of Visual Studio 2005.

MORE INFORMATION

To debug assemblies that are referenced in the code of a Script task, you must open an instance of Visual Studio 2005, and then attach the debugger to the Script task process. To do this, follow these steps.

Note To enable the assembly that is being debugged outside the Scrip task process, you must disable the Enable Just My Code (Managed only) option in Visual Studio 2005 before you build the assembly. For more information about how to disable this option, visit the following Microsoft Developer Network (MSDN) Web site:
  1. Break the process of the Script task before you step into the call of the referenced assembly. To do this, add a code to display a message box in your Script task code. The following code example illustrates how to do this.
    MsgBox("Continue")
    x = YouClass.YourMethod(variable)
    
  2. Run the SSIS package. When the execution is paused at the MsgBox call, do not click the OK button, and then open a new instance of Visual Studio 2005.
  3. In Visual Studio 2005, open the source file of the class library. The file may be a .cs file or a .vb file, depending on which language you used to write the class library.
  4. In Visual Studio 2005, click Attach to Process on the Debug menu.
  5. In the Available processes list, click the row where the Process column value is DtsBebugHost.exe and the Title column value is Script Task, and then click Attach.
  6. When the modules have been loaded, examine the output window to make sure that the symbols of the referenced assembly have been loaded.

    If the symbols are loaded successfully, you will see a message that resembles the following in the output window:'DtsDebugHost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\YourClass\1.0.0.0__848b89cbc77872dd\ YourClass.dll', Symbols loaded.
  7. In Visual Studio 2005, set the breakpoints in the source file for the referenced assembly.
  8. Continue to run the SSIS.
  9. In the message that you received in step 2, click OK.
To reference an assembly in the code of a Script task, you must copy the assembly to either the %windir%\Microsoft.NET\Framework\v2.0.xxxxx folder or the %ProgramFiles%\Microsoft SQL Server\90\SDK\Assemblies folder. The assembly must also be signed with a strong name and installed in the global assembly cache. For more information, visit the following MSDN Web site:

REFERENCES

For more information, see the following Microsoft Developer Network Web site:

Modification Type:MajorLast Reviewed:7/27/2006
Keywords:kbinfo kbtshoot kbsql2005ssis kbExpertiseAdvanced KB922647 kbAudDeveloper kbAudITPRO