‘Unknown command’ when debugging

By Adam Nagy

The most common reason why your command would not be recognized by AutoCAD when debugging your application is that the ‘Copy Local’ property of the reference to AcMgd.dll is not set to ‘False’ and so both the original AcMgd.dll from the AutoCAD folder, plus its copy from your project’s output folder will be loaded into AutoCAD.
Best to set the ‘Copy Local’ property of all references to AutoCAD API assemblies (AcMgd.dll, AcDbMgd.dll, etc) to ‘False’.

This important step is also mentioned in My First AutoCAD Plug-in >> Lesson 1 >> Step 7


Comments

3 responses to “‘Unknown command’ when debugging”

  1. Adam!
    There is also another reason why command would not be recognized: if command class is not public: http://forums.autodesk.com/t5/NET/AutoCad2010-with-Visualstudio-2008-c/td-p/3431991

  2. Hi Alexander,
    Thanks for the comment. :)
    Yes, that could be another issue. In this post I only focused on the one I found the most common.

  3. If anyone’s reading this, you might also need to load your dll from a trusted location. if you want to add another location do so like this: autocad –> File —> options —> add the folder to the trusted location.

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading