AutoCAD Plugin Will Not NetLoad - How to Diagnose

AutoCAD Plugin Will Not NetLoad - How to Diagnose

mszanto
Enthusiast Enthusiast
245 Views
0 Replies
Message 1 of 1

AutoCAD Plugin Will Not NetLoad - How to Diagnose

mszanto
Enthusiast
Enthusiast

I have yet to discover any documentation that describes how to troubleshoot an AutoCAD plugin that will not load therefore I put this together after I upgraded an especially complex project from 2018 to 2025 but could not get the assembly to load in AutoCAD. No exceptions were occurring, and it would not hit a breakpoint in the Initialize method of the class that inherits from IextensionApplication when I ran it from the debugger.
If anyone knows of other documentation like this, please add a link.

 

The following steps describe how to determine why a plugin fails to load in AutoCAD or any of its verticals.

 

  1. Start AutoCAD from the debugger or once it’s loaded attach to the acad.exe process in the debugger (I haven’t tested this using attach to process).
    NOTE: If you’ve configured your project to automatically load your plugin when AutoCAD starts, disable it (for example using a .scr file).
  2. In Visual Studio…
    NOTE: It’s important to perform these steps after starting AutoCAD to limit the output to information related to your plugin.
    • Tools > Options then search for Enable Just My Code and uncheck it.
    • Open Exception Settings and verify that Common Language Runtime Exceptions is fully checked.
      NOTE: This exception must be fully checked otherwise the offending assembly that’s blocking your plugin will not be displayed in the Output window.
      TIP: Managed Debugging Assistants should always be completely unchecked; these exceptions are a nuisance and have no value.
    • In the Output window, set ‘Show output’ to Debug and clear the output.
  3. Switch back to AutoCAD and NetLoad your plugin.
    For each exception, press F5 to continue until the plugin is fully loaded.
  4. Switch back to Visual Studio and copy the entire content of the Output window to a text editor.
  5. Search for the name of your assembly then look for any exceptions that immediately follow it, The exception should indicate why your plugin fails to load.
    In my case, System.Configuration.ConfigurationManager version 9.0.1 was the problem. It was included in a project referenced by the plugin project therefore, I had to down version it to 8.0.1.
    In some cases, you’ll need to expand each Nuget package in Solution Explorer to see the assemblies referenced by the package because the package may reference the offending assembly. For example, System.Data.OleDb 9.0.1 references System.Configuration.ConfigurationManager version 9.0.1.

 

After you copy the content to a text editor be sure to re-enable Just My Code and restore the exception setting for Common Language Runtime.

0 Likes
246 Views
0 Replies
Replies (0)