I am using a .Net dll Newtonsoft.Json in my C# TBB
to process components and generate Json data. I have already added this dll in GAC[Global Assembly Cache]
, and it works as well. But sometimes it doesn't work and I get the following error while publishing:
JScriptException: Expression 'RenderComponentPresentation()' had error 'Could not load file or assembly 'Newtonsoft.Json, Version=4.0.5.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.'
But when I preview the page in Tridion it works fine. To fix this issue we restart the Tridion Services
, and after restart we publish the page it woks fine. But this problem keep on reappearing again and again. Is there any way to solve this issue permanently?
Recently I could reproduce issue when I published the same page again when it was already under the process of getting published. The second publish attempt returned the above error, but the first publish attempt finished after the failure of second publish attempt and it returned Success
. Any idea why this weird behavior.