Debugging Custom SSIS Components

210 words.

Another in a series of random programming tips by Thomas Krehbiel, mostly to help me remember them in the future.

In order to debug custom SSIS components, you need to Attach a Visual Studio debugger to the SSIS package task. You can do it manually I suppose, but I had better luck doing this:

Load the SSIS component project (a class library) into VS2005. Open the project Debug properties. Set the run executable to devenv.exe (which is Visual Studio). Set the command-line argument to the location of your SSIS package.

You also need to copy the component DLL (and PDB debug file) to the GAC and the SQL Server DTS directory. I saw somewhere that you need to copy it to VSShellCommon7IDE too, but I don’t know why. Anyway, I put these commands in my Post-build event:

copy “$(TargetDir)$(TargetName).*” “D:Program FilesMicrosoft SQL Server90DTSPipelineComponents”

copy “$(TargetDir)$(TargetName).*” “D:Program FilesMicrosoft SQL Server90ToolsBinnVSShellCommon7IDE”

“C:Program FilesMicrosoft Visual Studio 8SDKv2.0Bingacutil.exe” /u “$(TargetName)”

“C:Program FilesMicrosoft Visual Studio 8SDKv2.0Bingacutil.exe” -iF “D:Program FilesMicrosoft SQL Server90DTSPipelineComponents$(TargetFileName)”

Now, when you hit F5, another instance of Visual Studio will open with your SSIS package loaded. Then when you run the SSIS package, breakpoints and exceptions will be thrown in the original instance of Visual Studio and you can see what’s going on.

Related

This page is a static archival copy of what was originally a WordPress post. It was converted from HTML to Markdown format before being built by Hugo. There may be formatting problems that I haven't addressed yet. There may be problems with missing or mangled images that I haven't fixed yet. There may have been comments on the original post, which I have archived, but I haven't quite worked out how to show them on the new site.

Sorry, new comments are disabled on older posts. This helps reduce spam. Active commenting almost always occurs within a day or two of new posts.