Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging SSIS Script task - Breakpoint is enabled but it does not hit

I am working on an SSIS package. The package has a script (C# language) task. I need to debug the script task. I set the break point. The script in script editor (Visual Studio) and the task in SSIS package editor, both, show break point in red color - means the break point is enabled. However, when I debug the package the break point does not hit.

The break point has no conditions on it, so I expect it to hit every time the package runs.

I am using Visual Studio 2008 on Windows 2003 R2 64-bit SP2.

like image 507
HappyTown Avatar asked Jan 04 '17 18:01

HappyTown


People also ask

What happens when a breakpoint is reached when the debugger is enabled?

If a breakpoint is reached, or a signal not related to stepping occurs before count steps, stepping stops right away. Continue to the next source line in the current (innermost) stack frame. This is similar to step , but function calls that appear within the line of code are executed without stopping.

How do you set a breakpoint in SSIS Script task?

Click Script and then click Edit Script. In Microsoft Visual Studio Tools for Applications (VSTA), locate the line of script on which you want to set a breakpoint, right-click that line, point to Breakpoint, and then click Insert Breakpoint. The breakpoint icon appears on the line of code. On the File menu, click Exit.

Why breakpoint is not hitting with VS code?

If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.

How do I debug a script component in SSIS?

To debug the code in your Script component, set at least one breakpoint in the code, and then close the VSTA IDE to run the package in SQL Server Data Tools (SSDT). When package execution enters the Script component, the VSTA IDE reopens and displays your code in read-only mode.


2 Answers

After more research and trial-error, found that the SSIS package ignores the breakpoints in a Script Task when debugging on a 64-bit machine. To fix it -

  1. Go to the Solution Explorer
  2. Right click your SSIS project node > Properties
  3. In Configuration Properties > Debugging > Debug Options > Set Run64BitRunTime to False.

SSIS Project configuration settings

After making this change, the breakpoints hit like magic.

like image 169
HappyTown Avatar answered Oct 19 '22 12:10

HappyTown


I tried all the answers provided here with no success (using VS2015). After some more searching I found this question that is actually an answer which stated that newer C# features / syntax were causing the debugger to not fire correctly.

In their example (and also mine) using string interpolation was causing the breakpoints to not be hit.

Replacing

$"{someVariable} - {someOtherVariable}"

with

string.Format("{0} - {1}", someVariable, someOtherVariable);

did the trick for me.

EDIT

It appears this issue has now been fixed with SQL Server Integration Services Projects, but you need to be running VS2019 to download it.

like image 37
PTD Avatar answered Oct 19 '22 12:10

PTD