Question
Ms
GB
Last activity: 1 May 2019 2:21 EDT
Integrating Nuget Package
Hi Team,
I have a requirement where I need to create JWT token from robotic desktop applications.I am trying to incorporate a nuget package for JWT token creation (System.IdentityModel.Tokens.Jwt). I have created component class library in .Net 4.5.
I have added the component class library dll and the other dependent dlls to openspan studio installation directory. Now I have added the component in my code.Though the code compiles fine but it is throwing runtime error with the following exception:
Exception Type: System.IO.FileLoadException
Message: "Could not load file or assembly 'Newtonsoft.Json, Version= Proprietary information hidden, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
FileName: "Newtonsoft.Json, Version= Proprietary information hidden, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed"
FusionLog: "WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
"
Please suggest.
Regards,
Ritun
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Ms
GB
To add on more it seems newtonsoft 4.5.0 has been used by openspan iteslf, but my component uses newtonsoft 10.X.
Is there anyway I can dynamically point to the 10X version? I have tried to add as assembly reference and made copy local true. but the error continues. It seems runtime it is unable to locate the newtonsoft10.X.
Please advise.
-
Gayathri Dhavamani
Pegasystems Inc.
US
Have you added the Newtonsoft.Json assembly to the project using the add reference panel?
Ms
GB
Yes I have added Newtonsoft.Json assembly 10.0.0 as a reference but as there is already another Newtonsoft 4.5 inside the openspan tool itself. It is overriding the one I am adding as reference and throwing me error.
Ms
GB
Hi Team,
Any idea/help on this?
Regards,
Ritun
Pegasystems Inc.
US
What is the error?
Ms
GB
Please see below exception:
Please see below exception:
Exception Type: System.IO.FileLoadException
Message: "Could not load file or assembly 'Newtonsoft.Json, Version= Proprietary information hidden, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
FileName: "Newtonsoft.Json, Version= Proprietary information hidden, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed"
FusionLog: "WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
"
Pegasystems Inc.
US
Please review: https://stackoverflow.com/questions/93879/hresult-0x80131040-the-located-assemblys-manifest-definition-does-not-match-t
Ms
GB
Thanks Grona for your response. But it seems a different issue altogether. Openspan uses Newtonsoft dll (lower version) so whenever I am adding reference of higher version of Newtonsoft (10.X) it is getting overridden by the lower one. I tried almost every way shown in the link but no luck :(
The purpose of using newtonsoft 10X was to create dynamic JWT token from Robotics. The nuget package has a dependency on newtonsoft 10.X
Regards,
Ritun
MacQuarie Group Ltd
IN
Hi Team,
I am also facing the same issue, is there a way to avoid this? I have added the package via a download from NuGet and imported the same package in my bot, but it's not allowing me to proceed further. Any links would help. Thanks
Anthem
US
Hey,
Can you please inform me how to override Newtonsoft.Json in Openspan ??
MacQuarie Bank Ltd
AU
It seems like the higher version of the nugget package is not properly supported within Pega Robotics, I did tried to use version 10 or above it is a cumbersome task. You first need to replace the NewtonSoft in installation folder with the version you are using, then you need to make changes in assembly file, appdata file if any and try setting the copy local to true.