Migrating existing packages - C# task is failing on a new server

Naomi Nosonovsky 8,051 Reputation points
2024-11-21T23:58:54.0533333+00:00

Hi,

We're migrating our SSIS server to a new server. Original server is Windows Server 16, SQL Server 2019. New server is Windows Server 2022 and OS is SQL Server 2022. We're getting the error on the packages that use C# script task:

Code: 0x00000005 Source: GetNewFileName GetNewFileName Description: Failed to compiled scripts contained in the package. Open the package in SSIS Designer and resolve the compilation errors. End Error Error: 2024-11-21 19:02:48.59 Code: 0x00000005 Source: GetNewFileName GetNewFileName Description: CS1056 - Unexpected character '$', ScriptMain.cs, 55,

Same package works fine on the old server. I used the local version (on my dev. machine), recompiled it (re-build solution), used Code Cleanup, but it is still working on the old server and not on the new one.

User's image

I'm not sure what else to try to make it work. I made minor changes to the script (removed old comment, etc.), but I'm still getting the same error.

Thanks in advance.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,289 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,675 questions
{count} votes

Accepted answer
  1. Yitzhak Khabinsky 26,296 Reputation points
    2024-11-22T18:44:12.7566667+00:00

    Hi @Naomi Nosonovsky,

    Interpolation in c# is dependent on the .Net Framework version! Overall, interpolation was introduced in c# v6.0 which is part of the .NET Framework 4.6

    Please make sure that a correct .Net Framework version is installed on the new SSIS run-time server. It should be at least v4.6, or later like v4.7.2. Please see below.

    Additionally, you would need to make few changes in Visual Studio SSIS Project properties before you can deploy SSIS Project to a new SSIS run-time server:

    1. It is important to set the TargetServerVersion setting in Visual Studio to match your SSIS run-time server version, i.e. SQL Server instance version: SQL Server 2022.
    2. Open Script Tasks in Visual Studio, and re-build them to make sure they are compiled based on the TargetServerVersion setting.

    SSIS  - Script Task Target framework


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.