You are viewing limited content. For full access, please sign in.

Question

Question

newtonsoft json reference in a workflow SDK script

asked on September 6, 2023

I have a need to use a third party library in a SDK script.

It has a dependency of Newtonsoft.Json v12.0.3

 

Where do I place this dll and set the reference path?

The third party and other dependencies are in the install directory, but I can not add the Newtonsoft.Json v12.0.3 there. (It breaks workflow designer)

I tried putting it in a subfolder, and referencing it there. The script executes in the designer, but when published, workflow errors that it can't find the Newtonsoft.Json v12.0.0.dll.

 

Workflow 11

0 0

Replies

replied on September 13, 2023

Newer versions of Workflow 11 have moved Newtonsoft.Json to a subfolder of the install folder to allow for the possibility of multiple versions. It currently is in <WF Install folder>\Newtonsoft\11.0.0.0

You may be able to  add your version to a subfolder and reference it from there. You'd want to make a subfolder with the assembly version in <WF Install folder>\Newtonsoft and place the file in it and reference it from there. You may also need to update the "assemblyBinding" section of the Laserfiche.Workflow.Service.exe.config and add the new path to "privatePath" under "probing".

2 0
replied on September 21, 2023 Show version history

Miruna gave me just what I needed!  Thanks!

Here's the step-by-step:

1. Created folder (E:\Program Files\Laserfiche\Laserfiche Workflow 11\Newtonsoft\13.0.0.0) & placed the new version of the Newtonsoft.dll in the folder.


2. Modified Newtonsoft version from 11.0.0.0 to 13.0.0.0 in the Laserfiche.Workflow.Subscriber.exe.config file located in Workflow install folder.

     <probing       privatePath= "RepositoryAccess;RepositoryAccess\11.0.0.0;Newtonsoft;Newtonsoft\13.0.0.0


3. Modified the same file (Laserfiche.Workflow.Subscriber.exe.config) to add the dll information and placed it after the last </dependentAssembly> found:

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

4. Closed Workflow Designer

5. Restarted the "Laserfiche Workflow 11" service

6. Opened Workflow Designer and modified the workflow script to include the new assembly with the new location.

  • Open the script. 
  • Right-click on References. 
  • Click "Add Reference". 
  • Do not select from list but click "Browse". 
  • Browse to the dll location (ex. (E:\Program Files\Laserfiche\Laserfiche Workflow 11\Newtonsoft\13.0.0.0). 
  • If asked, to use the new file, click "yes". 
  • Rebuild solution. 
  • Close the script & Publish the Workflow.


The workflow will now run without the "Could not load file or assembly..." error.

1 0
replied on September 8, 2023

I think it's part of the Office Integration with the Laserfiche Web Client. On a desktop it would prompt you to install it whenever needed. This is where it's located on my machine:


 

Not sure what the easiest way is to get it on a server. You probably wouldn't get the prompt there as you likely don't have Office installed on it. I don't think you can download it separately from the support website either.

Pretty sure it can be found in the Web Client installation on your web client server. I *think* the LfWebOffice110.exe file contains it. Located here:

So maybe you manually install it.

0 0
replied on September 13, 2023

I had this issue before and not sure if you can work around it. Basically, there is a version of Newtonsoft.json that ships with workflow and I ended up having to use their version as when I tried importing the newer version workflow completely stopped working. I believe it was version 11 and you will find it in one of the workflow subfolders.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.