Skip to content

ClearScript Excessive COM Type Library Loading #645

Description

@matvdl

ClearScript Version: 7.5
.NET Version: 4.6.2

Issue:
We are integrating ClearScript into our .NET application, which heavily utilizes COM interop. After adding our primary COM object using AddHostObject, any access from script triggers extensive and repeated calls to TypeLibConverter.ConvertTypeLibToAssembly

These repeated type library conversions cause significant delays (minutes), and Visual Studio's Modules window shows COM libraries loading multiple times.

We've already tried:

  1. Using HostItemFlags.DirectAccess — No improvement
  2. Switching to AddCOMObject instead of AddHostObject — No improvement
  3. Ensuring Embed Interop Types is set to false — No improvement
  4. Wrapping objects explicitly using Marshal.CreateWrapperOfType helps initially, but associated COM object accesses trigger the issue again.
  5. We have tried in both the legacy JScript engine and V8 engine - does not seem to make a difference.

Questions:
Is there a recommended approach or setting in ClearScript to avoid repeated COM type library loading? It's taking around 5m to load the info and finally return.

Any guidance would be greatly appreciated—thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions