Could not load file or assembly 'Microsoft.Diagnostics.FastSerialization', An operation is not legal in the current state. (0x80131509

Raghu M 0 Reputation points
2025-01-31T21:53:56.9633333+00:00

I have C# project that generates a DLL and exposes static methods to JavaScript (using Microsoft.JavaScript.NodeApi). The DLL exported methods launches an ETL collection. When this static method is called from C#, it works as expected. But calling this from javascript throws the below error:

Error: Could not load file or assembly 'Microsoft.Diagnostics.FastSerialization, Version=3.1.17.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. An operation is not legal in the current state. (0x80131509)

I have no idea what this means and searching online resulted in no luck. Any help/guidance is much appreciated.

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
1,042 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.