4

I am trying to make Microsoft.Azure.Services.AppAuthentication and its dependencies work with SSIS script task. How do I resolve assembly reference errors?

enter image description here


static ScriptMain()
{
    AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
}

static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{

    if (args.Name.Contains("Microsoft.Azure.Services.AppAuthentication"))
    {
        return System.Reflection.Assembly.LoadFile(@"C:\Azure\packages\Microsoft.Azure.Services.AppAuthentication.1.6.2\lib\net472\Microsoft.Azure.Services.AppAuthentication.dll");
    }

    if (args.Name.Contains("Microsoft.IdentityModel.Clients.ActiveDirectory"))
    {
        return System.Reflection.Assembly.LoadFile(@"C:\Azure\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.9\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll");
    }   
}
Yahfoufi
  • 2,220
  • 1
  • 22
  • 41
pbj
  • 663
  • 1
  • 8
  • 19

1 Answers1

4

Nuget packages are not supported in SSIS script task/component. You need to download the assemblies manually from the GitHub repository.

Next, you should add these assemblies to the Global cache assembly (GAC):


You can refer to the following article for more guidance:

Yahfoufi
  • 2,220
  • 1
  • 22
  • 41