question

HewChiouJin-9882 avatar image
0 Votes"
HewChiouJin-9882 asked KJN-8403 published

Execute SSIS package from .NET Core 5.0 application

Could you please advise how can i resolve the issue, I'm trying to migrate the current net472 project to net5.0 project, and encountered the System.TypeLoadException error while initialize the IntegrationServices with SqlConnection.

using (var connection = new SqlConnection(_connectionString))
{
    var catalog = (new IntegrationServices(connection));
    ....
}

System.TypeInitializationException: The type initializer for 'Microsoft.SqlServer.Management.IntegrationServices.IntegrationServices' threw an exception.
 ---> System.TypeInitializationException: The type initializer for 'Microsoft.SqlServer.Diagnostics.STrace.STraceSource' threw an exception.
 ---> System.TypeLoadException: Could not load type 'Microsoft.SqlServer.Server.SqlContext' from assembly 'System.Data, Version=4.0.0.0,
dotnet-csharp
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Did you install the current version of Microsoft.SqlServer.SqlManagementObjects?

Install-Package Microsoft.SqlServer.SqlManagementObjects -Version 161.46367.54

0 Votes 0 ·

Yes, we have tried but having the same issue

0 Votes 0 ·

Is anyone aware of any work-arounds, however convoluted?

0 Votes 0 ·

Is anyone aware of any work-arounds, however convoluted?

0 Votes 0 ·
DanielZhang-MSFT avatar image
0 Votes"
DanielZhang-MSFT answered DanielZhang-MSFT edited

Hi HewChiouJin-9882,
From this document, we can see that Microsoft.SqlServer.SqlManagementObjects is not supported in .NET Core 5.0.
And as announced in the .NET blog, improvements to the new SqlClient functionality are being transferred to the new Microsoft.Data.SqlClient package.
There are still different functional support between SqlClient for .NET Framework and SqlClient for .NET Core. If you want to migrate from .NET Framework to .NET Core, but are blocked because .NET Core does not yet support a certain feature (except Always Encrypted).
Best Regards,
Daniel Zhang


If the response is helpful, please click "Accept Answer" and upvote it.

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.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is there any other alternative solution to execute SSIS package from .NET Core 5.0?

0 Votes 0 ·

Hi @HewChiouJin-9882,
In the Frequently Asked Questions document, they said that "We've been porting SqlClient feature changes from the Framework code to the Core code to bring the targets up to feature parity. But there are still a few things left to do".
You can also use the issue tracker at dotnet/SqlClient to report any questions to ask for the latest progress
Daniel Zhang


0 Votes 0 ·
RKSambangi-9636 avatar image
0 Votes"
RKSambangi-9636 answered HewChiouJin-9882 commented

Hello, I am having the same issue trying to execute an SSIS package from a .NET 5.0 console application. Any update on this?

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RKSambangi-9636 avatar image
0 Votes"
RKSambangi-9636 answered

Thanks for the suggestion but that doesn't meet the requirements. I was hoping to get an update on whether there was any plan to port the library to .net core.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.