microsoft / sqlmanagementobjects

Sql Management Objects, an API for scripting and managing SQL Server and Azure SQL Database
Other
130 stars 21 forks source link

Failed to load assembly Microsoft.SqlServer.Management.IntegrationServicesEnum.dll #168

Open barfootar opened 3 months ago

barfootar commented 3 months ago

This is a repost of the issue I first posted https://github.com/actions/runner-images/discussions/10171

I'm having an issue with an application deployed from Azure DevOps to a Windows Server 2019 machine. Turns out the Build Pipeline isn't copying all the Assemblies from sqlserver.smo.2016.13.0.0.2.nupkg after the NuGet Restore option.

When deployed the artefacts are missing just the one Assembly from the original NuGet Package. Hence the error,

The log shows : https://pkgs.dev.azure.com/{Organisation}/05dc77d4-afba-4f3c-ba2d-c5898a402225/_packaging/d33f9d5a-f68c-4a5c-9958-f326ebb73865/nuget/v3/flat2/sqlserver.smo.2016/13.0.0.2/sqlserver.smo.2016.13.0.0.2.nupkg GET https://api.nuget.org/v3-flatcontainer/sqlserver.smo.2016/13.0.0.2/sqlserver.smo.2016.13.0.0.2.nupkg

Acquiring lock for the installation of SQLServer.SMO.2016 13.0.0.2 Acquired lock for the installation of SQLServer.SMO.2016 13.0.0.2 Installing SQLServer.SMO.2016 13.0.0.2.

Completed installation of SQLServer.SMO.2016 13.0.0.2 Adding package 'SQLServer.SMO.2016.13.0.0.2' to folder 'D:\a\1\s\packages' Added package 'SQLServer.SMO.2016.13.0.0.2' to folder 'D:\a\1\s\packages' Added package 'SQLServer.SMO.2016.13.0.0.2' to folder 'D:\a\1\s\packages' from source 'https://api.nuget.org/v3/index.json'

However just one Assembly is missing and that is : Microsoft.SqlServer.Management.IntegrationServicesEnum.dll

The Packages.Config references the NuGet Package : [package id="SQLServer.SMO.2016" version="13.0.0.2" targetFramework="net472" /]

The same issue occurs when building the project in Visual Studio 2019 and 2022 I have added an Installer Project and when that is built. the one file missing is the same Microsoft.SqlServer.Management.IntegrationServicesEnum.dll

shueybubbles commented 3 months ago

I don't know what that nuget package is. The Microsoft official package for SMO is Microsoft.SqlServer.SqlManagementObjects

barfootar commented 2 months ago

Hi David Please could you let me know all the Libraries/ that will be used to access the SSISDB Project / Catalog and allow Execution of packages and logging of SSIS Errors.

The Package Viewer does show XML files which describe the content, but it’s really time consuming to go through every file as it's not clear what function each library has.

I’ve managed to create a new branch off my main code Batch_1.1.1 which has all my changes including the Installer Package.

However, I’m now going to create a new Branch, probably 1.2 which will encompass the change of package. This could be a huge game changer, because I don’t know how that will affect my code.

I’m not the author of the code as this was completed by an InfoSys Contractor. So I may need some help if the library references are changing.

So one of the code snippets suggested. I need to know where the reference to IntegrationsServices is coming from in your supported Package.

using Microsoft.SqlServer.Management.IntegrationServices; using System.Data.SqlClient;

namespace run_ssis_package { class Program { static void Main(string[] args) { // Variables string targetServerName = "localhost"; string folderName = "Project1Folder"; string projectName = "Integration Services Project1"; string packageName = "Package.dtsx";

        // Create a connection to the server
        string sqlConnectionString = "Data Source=" + targetServerName +
            ";Initial Catalog=master;Integrated Security=SSPI;";
        SqlConnection sqlConnection = new SqlConnection(sqlConnectionString);

        // Create the Integration Services object
        IntegrationServices integrationServices = new IntegrationServices(sqlConnection);

        // Get the Integration Services catalog
        Catalog catalog = integrationServices.Catalogs["SSISDB"];

        // Get the folder
        CatalogFolder folder = catalog.Folders[folderName];

        // Get the project
        ProjectInfo project = folder.Projects[projectName];

        // Get the package
        PackageInfo package = project.Packages[packageName];

        // Run the package
        package.Execute(false, null);

    }
}

}

Many thanks, Andy

From: David Shiflet @.> Sent: Friday, July 19, 2024 2:01 PM To: microsoft/sqlmanagementobjects @.> Cc: Andrew Barfoot @.>; Author @.> Subject: Re: [microsoft/sqlmanagementobjects] Failed to load assembly Microsoft.SqlServer.Management.IntegrationServicesEnum.dll (Issue #168)

I don't know what that nuget package is. The Microsoft official package for SMO is Microsoft. SqlServer. SqlManagementObjects — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored ZjQcmQRYFpfptBannerStart This Message Is From an External Sender Be cautious with links and attachments – report suspicious emails. ZjQcmQRYFpfptBannerEnd

I don't know what that nuget package is. The Microsoft official package for SMO is Microsoft.SqlServer.SqlManagementObjectshttps://urldefense.com/v3/__https:/www.nuget.org/packages/Microsoft.SqlServer.SqlManagementObjects__;!!PUVePWy_yMB-Yi4!HjASV0r_ZXCaNB5WWTfeFQihjiBqcTAiN0CBsu-b_Vqpp_uzKxJPMSjkCZs8MqEHhASwFGtm-bBjQ8KwDkJQO1FhWwKFyR5hBoa0S90$

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/microsoft/sqlmanagementobjects/issues/168*issuecomment-2239081931__;Iw!!PUVePWy_yMB-Yi4!HjASV0r_ZXCaNB5WWTfeFQihjiBqcTAiN0CBsu-b_Vqpp_uzKxJPMSjkCZs8MqEHhASwFGtm-bBjQ8KwDkJQO1FhWwKFyR5hsKP43K0$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/BAT6OI7QZEU5LJMRZBTKEOTZNEEW5AVCNFSM6AAAAABLEQIXXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZZGA4DCOJTGE__;!!PUVePWy_yMB-Yi4!HjASV0r_ZXCaNB5WWTfeFQihjiBqcTAiN0CBsu-b_Vqpp_uzKxJPMSjkCZs8MqEHhASwFGtm-bBjQ8KwDkJQO1FhWwKFyR5hqLG6QC8$. You are receiving this because you authored the thread.Message ID: @.**@.>>

barfootar commented 2 months ago

Sorry David, I thought this was the Microsoft response to my Support request. I think this message doesn’t go to any particular person, so might not be looked at anyhow.

Just in case, You can completely ignore my last response.

Andy

From: David Shiflet @.> Sent: Friday, July 19, 2024 2:01 PM To: microsoft/sqlmanagementobjects @.> Cc: Andrew Barfoot @.>; Author @.> Subject: Re: [microsoft/sqlmanagementobjects] Failed to load assembly Microsoft.SqlServer.Management.IntegrationServicesEnum.dll (Issue #168)

I don't know what that nuget package is. The Microsoft official package for SMO is Microsoft. SqlServer. SqlManagementObjects — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored ZjQcmQRYFpfptBannerStart This Message Is From an External Sender Be cautious with links and attachments – report suspicious emails. ZjQcmQRYFpfptBannerEnd

I don't know what that nuget package is. The Microsoft official package for SMO is Microsoft.SqlServer.SqlManagementObjectshttps://urldefense.com/v3/__https:/www.nuget.org/packages/Microsoft.SqlServer.SqlManagementObjects__;!!PUVePWy_yMB-Yi4!HjASV0r_ZXCaNB5WWTfeFQihjiBqcTAiN0CBsu-b_Vqpp_uzKxJPMSjkCZs8MqEHhASwFGtm-bBjQ8KwDkJQO1FhWwKFyR5hBoa0S90$

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/microsoft/sqlmanagementobjects/issues/168*issuecomment-2239081931__;Iw!!PUVePWy_yMB-Yi4!HjASV0r_ZXCaNB5WWTfeFQihjiBqcTAiN0CBsu-b_Vqpp_uzKxJPMSjkCZs8MqEHhASwFGtm-bBjQ8KwDkJQO1FhWwKFyR5hsKP43K0$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/BAT6OI7QZEU5LJMRZBTKEOTZNEEW5AVCNFSM6AAAAABLEQIXXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZZGA4DCOJTGE__;!!PUVePWy_yMB-Yi4!HjASV0r_ZXCaNB5WWTfeFQihjiBqcTAiN0CBsu-b_Vqpp_uzKxJPMSjkCZs8MqEHhASwFGtm-bBjQ8KwDkJQO1FhWwKFyR5hqLG6QC8$. You are receiving this because you authored the thread.Message ID: @.**@.>>