VS 2015 SSIS Script Tasks cannot be debugged

后端 未结 5 716
醉梦人生
醉梦人生 2020-12-03 15:03

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 s

相关标签:
5条回答
  • 2020-12-03 15:06

    Also spent hours pulling my hair out and found out it is indeed due to new Roslyn compiler features not being recognised in older versions of Visual Studio. (I am using VS2015 with an SSIS Script Task)

    To get the breakpoints to hit, I opened project in earlier version of VS (2012) and made changes to source code to get it to compile successfully. Once i got it to build i ran in 2012 and voilà! - it hits all the breakpoints. Re-opened project and ran in VS2015 and confirmed it works as intended.

    0 讨论(0)
  • 2020-12-03 15:09

    I'd like to think the above has cured my issue, but there was another cause/work around that I needed to implement to get script task debugging working again.

    In my instance, the issue was the debugger integration used by Resharper, as highlighted by user "Richard T. LaSalle" in the linked solution to the following issue: Could not set BreakPoint in SSIS ScriptTask

    TL;DR, If using Resharper, turn off Debugger Integration

    0 讨论(0)
  • 2020-12-03 15:10

    Spent hours too and then finally found your post... thank you sir!

    I'm using VS2015 with SSIS Script Task too. For me it was the function nameof() that was responsible for not firing up the debugger. Replacing the function with reflection worked for me: Get string name of property using reflection

    0 讨论(0)
  • 2020-12-03 15:23

    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.

    0 讨论(0)
  • 2020-12-03 15:31

    Microsoft released an update v3.2 of SQL Server Integration Services Projects where it resolves the issue with Roslyn and other C# language features introduced after .Net 4.5. C# features.
    Bad news - this fix is for Visual Studio 2019 only, you have to upgrade your VS to use it.

    0 讨论(0)
提交回复
热议问题