-1

Can anybody help to resolve this. I have added third party reference (Json newtonsoft) dll in my script component, but when i run the package through sql server agent, I am getting an error

Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.

I have registered the dll in gac and same dll (even same version) is also used in uat but while executing on prod it is getting failed. Any suggestions?

Jai A
  • 1

2 Answers2

0

Firstly I would check that the version in the web.config matches the version of the DLL. Right click on the newstonsoft.dll and go to details tab, product version.

You should then have a corresponding assembly identity in your web.config like

   <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" 
    publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" 
     newVersion="10.0.0.0" />
    </dependentAssembly>

Also if you have multiple projects in your solution then right click your solution, manage nuget packages for solution and go to the consolidate tab to check that you don't have multiple versions of newtonsoft

JKerny
  • 488
  • 1
  • 3
  • 19
0

Finally resolved the issue- The command to register DLL was having space before the DLL name. While registering through cmd it showed registering success however the folder was not created in gac_msil location I. E. dll was not registered.

Jai A
  • 1