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

Question

Question

Document Preview Service Not Working, Newtonsoft.Json.dll Errors

asked on October 11, 2020

Since recently upgrading to Web Access 10.4.2.214 in our live production environment, we have lost the ability to preview Microsoft Office documents without opening the electronic file.  In the web client, all we get is an error in the middle of the preview pane that states "One or more errors occurred."

I've tried uninstalling and reinstalling with no change.

When I switch the diagnostics logging level to debug, I do get some relevant entries in the Event Log:

 

One or more errors occurred.
Operation: /laserfiche/DocumentService.ashx/GetMetisToken
  Message: Exception encountered, stack trace:
  WebAccessServices.HttpHandlers.DocumentService.GetMetisToken
  System.RuntimeMethodHandle.InvokeMethod
  System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal
  System.Delegate.DynamicInvokeImpl
  WebAccessServices.HttpHandlers.BaseWAIHttpHandler.InvokeFunction
  WebAccessServices.HttpHandlers.BaseWAIHttpHandler.ProcessRequestInternal
Exception details:
  Message: One or more errors occurred.
  Stack trace:    at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at WebAccessServices.HttpHandlers.DocumentService.GetMetisToken(String repoName, Int32 documentId, String version)
  Message: Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, 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)
  Stack trace:    at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter..ctor()
   at System.Net.Http.Formatting.JsonMediaTypeFormatter..ctor()
   at WebAccessServices.HttpHandlers.DocumentService.<SendToMetis>d__93.MoveNext()
  Message: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, 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)

 

Any idea what might be the problem here?  I've checked file versions on the Newtonsoft.Json.dll assemblies and they all appear to be correct.  We have a Development and UAT environment running the same versions of everything and we're not having this problem on those servers.  I've even compared everything I can think of between the separate environments and everything appears to be the same. 

0 0

Answer

SELECTED ANSWER
replied on December 1, 2020

I would recommend re-installing LDPS. It looks like the version of Netwonsoft.Json that you should have is 10.0.3.21018.

You should also look in the GAC and see if there is another version in there - that may be where the version 6 is coming from. Having an old version in the GAC can prevent .Net from finding the newer version in the local directory. In that case, you might try using gacutil.exe to copy version 10 into the GAC.

0 0

Replies

replied on October 12, 2020

It looks like the installer might not have updated the Newtonsoft.Json assembly correctly. The error message talks about both version 6 and version 10. Can you compare the version of that file that are present on the working machine and the non-working one?

0 0
replied on October 12, 2020 Show version history

Hi Brian,

Thanks for the help.  I've done comparisons and the files all appear to be correct in terms of size and file version.  I've also tried re-installing the Document Preview Service a number of times with no change.

I think my next step is to try uninstalling the web client and LDPS, clean out files, and then re-install both.  I need to book time on the servers and schedule an outage to do this, so it might be a couple of days, but in the meantime if you or anyone else has any suggestions I'm all ears.

0 0
SELECTED ANSWER
replied on December 1, 2020

I would recommend re-installing LDPS. It looks like the version of Netwonsoft.Json that you should have is 10.0.3.21018.

You should also look in the GAC and see if there is another version in there - that may be where the version 6 is coming from. Having an old version in the GAC can prevent .Net from finding the newer version in the local directory. In that case, you might try using gacutil.exe to copy version 10 into the GAC.

0 0
replied on January 21, 2021

Sorry, I just realized I never did follow up here.

Re-installing or repairing LDPS didn't do anything to help the issue, unfortunately.  For some reason it took a full uninstall of the web client and LDPS and a complete re-install of both for the issue to finally get fixed. 

Thanks for your assistance in any case Brian.

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

Sign in to reply to this post.