Unable to load System.Text.Json.dll 9.0.0.0+ (and/or dependencies) in 2025+
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Our .NET plugin has a hard dependency on the .dll mentioned in the title. It gives a very not-helpful exception when trying to load it. We can maybe get away with loading an older version, but that could mean missing methods etc. to deal with.
Directly loading using NETLOAD also gives the exception (see below).
We are looking for suggestions/ideas to load the assembly (and dependencies) regardless.
Command: NETLOAD
Cannot load assembly. Error details: System.IO.FileLoadException: Could not load file or assembly 'System.Text.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
at System.Runtime.Loader.AssemblyLoadContext.<LoadFromPath>g____PInvoke|5_0(IntPtr __ptrNativeAssemblyBinder_native, UInt16* __ilPath_native, UInt16* __niPath_native, ObjectHandleOnStack __retAssembly_native)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
at Autodesk.AutoCAD.ApplicationServices.ExtensionLoader.Load(String fileName)
at loadmgd()This seems to be isolated to the AutoCAD .NET environment. Directly loading the assembly in the same .NET8 environment (".NET 8.0.21") outside of AutoCAD works perfectly fine.
Older versions of AutoCAD also load the assembly (the .NET framework version of course!) fine, as in no meaningless exception .
We have tried a custom/isolated AssemblyLoadContext, doesn't improve the issue.
We can't use IPC, this is the IPC we want to use.