autocadautocad-plugin

.NET 9 Compatibility with AutoCAD 2025 .NET API


I tried updating our AutoCAD plugin from .net 8 to .net 9 version and unable to load the application with AutoCAD 2025. With .net 8 it works well. After changing the target framework to .net 9 and when we try to netload we get the following error.

Any idea on the compatibility of .net 9 with AutoCAD 2025 API?

Cannot load assembly. Error details: System.IO.FileNotFoundException:
Could not load file or assembly 'System.Runtime, Version=9.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot 
find the file specified. File name: 'System.Runtime, Version=9.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at 
System.ModuleHandle.ResolveType(QCallModule module, Int32 typeToken, 
IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32
methodInstCount, ObjectHandleOnStack type)

After changing the target framework to .net 9 and when we try to netload we get the above error. I was expecting AutoCAD to load the dll without any error.


Solution

  • AutoCAD 2025 requires to target .NET 8.0. See https://help.autodesk.com/view/OARX/2025/ENU/?guid=GUID-A6C680F2-DE2E-418A-A182-E4884073338A