Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Just spent hours pulling my hair trying to work out why my ssis Script Component was not breaking into debugger on hitting a breakpoint. I searched the web and fund 64 bit setting (Project -> Properies -> Debugging) to be turned off but it didn't help me.

It turns out that if I use string interpolation ( $"{someVar}" ) in my code then debugger does not start. Once I replaced it with the old string.Format("{0}...", param1, ...) method my breakpoints got hit and I could step through the code.

The code works either way and it is just the debugger that is affected by the newer syntax.

I hope this helps someone.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
309 views
Welcome To Ask or Share your Answers For Others

1 Answer

Indeed, limiting C# Script Tasks to language features of C# 4.0 brings the Debugger back to life. In my case, adding a single null-coalescing operator caused the debugger issue using Visual Studio 2015 (VSTA) on SQL Server/SSIS 2016.

To restrict the Script to C# 4.0 we can enforce a specific Language Level in the Build settings of the Task:

  • Open the Script Task in question, click the "Edit Script..." button to open Visual Studio (VSTA).
  • In the Solution Explorer right-click the Project node and select Properties
  • In the Project window, go the Build tab, scroll down and click the Advanced.. button.
  • In the Advanced Build Settings window change the Langauge Version from "default" to "C# 4.0".
  • Clean/Rebuild the Script Task, fix compilation errors.
  • Finally, exit VSTA, rebuild the project

and then you should be able to debug the C# Script Task again.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...