Problem Debugging AutoCAD Plugin with Visual Studio: Assembly Loaded from Temp Folde

Problem Debugging AutoCAD Plugin with Visual Studio: Assembly Loaded from Temp Folde

b0166408
Participant Participant
864 Views
4 Replies
Message 1 of 5

Problem Debugging AutoCAD Plugin with Visual Studio: Assembly Loaded from Temp Folde

b0166408
Participant
Participant

I'm facing a challenge developing a plugin for AutoCAD and would like to ask for your help or insights.

I recently started working on a plugin for AutoCAD using Visual Studio. The project compiles without problems, and the .pdb file for debugging is generated correctly in the C:\Users\User\source\repos\CivilPset\CivilPset\bin\x64\Debug folder. However, when I try to debug the plugin in AutoCAD using the AddIn Manager, I am encountering a peculiar situation: Visual Studio is not loading the assembly from the Debug folder as expected. Instead, the plugin is loaded from a temporary folder (C:\Users\User\AppData\Local\Temp\AcadAddins...), and this has prevented breakpoints from being hit during debugging. The error message displayed by Visual Studio is "Binary was not built with debug information."

Here are some points I checked:

The plugin is compiled in Debug mode, and the .pdb file is present in the project's output folder.
The project settings in Visual Studio appear to be correct, including the options for generating debug information.
I tried manually copying the DLL and PDB file to the mentioned temporary folder, but the problem persists.
This behavior is puzzling, especially because Visual Studio and AddIn Manager appear to be redirecting execution to a temporary folder rather than using the project output folder where the debug files reside. This results in the inability to reach breakpoints and effectively debug the code.

I would like to know if anyone has faced a similar situation or has suggestions on how to resolve this issue. Is there a specific setting in Visual Studio, AutoCAD, or the plugin loading process that I may have missed? Any help or direction would be greatly appreciated.

Thank you in advance for your assistance and time.

0 Likes
865 Views
4 Replies
Replies (4)
Message 2 of 5

Ed__Jobe
Mentor
Mentor

Just NETLOAD the dll from the debug folder. Personally, I use my partial menu's mnl file to load the dll on startup.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 3 of 5

BlackBox_
Advisor
Advisor

I use Autoloader, as I can not only build right to the app's .bundle folder, but the PackageContents.xml file allows me to also easily add custom sysvars, etc as needed in one place - it also makes it easy to use in-house or for publishing apps to Autodesk Exchange.


"How we think determines what we do, and what we do determines what we get."

Sincpac C3D ~ Autodesk Exchange Apps

0 Likes
Message 4 of 5

b0166408
Participant
Participant

But, if I NETLOAD, i can't build without close Civil 3D. Thats why i am trying using Addimaeger

0 Likes
Message 5 of 5

Ed__Jobe
Mentor
Mentor

@b0166408 wrote:

But, if I NETLOAD, i can't build without close Civil 3D. Thats why i am trying using Addimaeger


Since you can't "unload" a dll, you have to restart AutoCAD each time you update your code and start a new debugging session. The best you can do is automatically netload your dll. @BlackBox_ mentioned Autoloading, that works the same way. I have my own system that I developed before autoloader technology arrived, so I just use an mnl. You could also use acad.lsp. If you want to debug with a specific dwg, you can change your VS project to include the file path to your dwg in the startup command line switch.

 

You can also check Hot Reload to avoid reloading the dll each time.

acad Project Debug settings.png

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes