I want to create .Net 5 application that can run SSIS package.
Here is my code to execute the package.
Application app = new Application();
Package package = app.LoadPackage(@"C:\Package1.dtsx", null);
for (int i = 0; i < package.Connections.Count; i++)
{
Connections connections = package.Connections;
//This is the line that causes error
ConnectionManager connectionManager = connections[0];
Console.WriteLine(connectionManager.Name);
}
DTSExecResult results = package.Execute();
It compiles without error, but when executed, at line that get the connection, it raise an error that said
Could not load file or assembly 'Microsoft.SqlServer.Diagnostics.STrace, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'. The system cannot find the file specified.
I can't even find dll for Microsoft.SqlServer.Diagnostics.STrace
. I think its because I use .Net Core and the SSIS library only support .Net Framework, but running SSIS is required in the project so I tried to find a way to execute it even though the resulting .Net Core application can only be used in windows environment. Any one knows how to do this?