SqlServer.ManagedDTS DLL Reference Error for Visual Studio 2019

Kamel Jtita 1 Reputation point
2022-10-06T12:51:04.557+00:00

Hello Everybody;
Visual Studio 2019 Enterprise v16.11.15
Sql Server Integration services v3.16
I try to Load my DTSX Package as File from Framework C# solution.
I add reference Microsoft.SqlServer.Dts.Runtime to my project throwing browse dll within :
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\PublicAssemblies\SSIS\150
When running reach the instruction :

Microsoft.SqlServer.Dts.Runtime.Application app = new Microsoft.SqlServer.Dts.Runtime.Application();
I get the following output Error :
System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.SqlServer.DTSRuntimeWrap, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The specified file can not be found.'

Just the same Script.Main is working perfect when i downgrade the DTS.Runtime reference to the ManagedDTS version 14 or older. The problem that the TargetServerVersion of SQL Server 2019 is only able in Version 15.
If someone has a solution i would be grateful. Thanks in advance.

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,459 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,292 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jack J Jun 24,296 Reputation points Microsoft Vendor
    2022-10-10T02:01:55.383+00:00

    @Kamel Jtita , Welcome to Microsoft Q&A, based on my test, I reproduced your problem.

    Please refer to the following steps to solve your problem.

    First. Please remove your initial ManagedDTS dll from your app.

    Second, please add the ManagedDTS dll in the following path:

    C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.ManagedDTS\v4.0_15.0.0.0__89845dcd8080cc91  
    

    Third, please change your platform target from AnyCPU to X64.

    Finally, it will not throw the above error.

    Best Regards,
    Jack


    If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

  2. Kamel Jtita 1 Reputation point
    2022-10-13T15:40:41.65+00:00

    Thank you for reply , sorry but is not suitable to me to have SQL Server on my DEV PC .
    But Finally i succeed to workaound the issue throw changing the type of VS 2019 Solution from Console Application to SSIS Project. I put my code in Task Script component and i reference SQL Server ManagedDTS dll from C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\PublicAssemblies\SSIS\150
    Now, i can running my solution and call succefully function App.SaveAndUpdateVersionToXml to upgrade automatically all packages DTSX by Script from Microsoft Framework 4.7 class.
    @Jack J Jun : Thank you very much for your attention and help.
    Regards.

    0 comments No comments