Hello,
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.
@b0166408 wrote:<QUOTE>
Hello,
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.
</QUOTE>
Firstly, your post is really hard for people to read (probably one of the reasons for no responds to it). I had to quote your post as plain text here in order to read it easier.
When you say "when I try to debug the plugin in AutoCAD using the AddIn Manager,...", what "AddIn Manager" you referred to? I never know one can debug AutoCAD .NET plugin with some sort of "AddIn Manager", so what is the "Addin Manager"? You may want to describe how do you run debugging with Visual Studio, which should be something like:
1. In VS Project's properties->Debug tab
a. select radio button "Start extenal program, and enter "C:\Program Files\Autodesk\AutoCAD 2024\acad.exe";
b. in Command line argument, enter proper AutoCAD start argent, such as "/ld "C:\Program Files\Autodesk\AutoCAD 2024\AecBase.dbx" /p "[profileName]" /product C3D /language en-US". This is not required, but recommended;
2. apply some kind of DLL auto-load mechanism. Again, this is not required, but recommended. You can always manually enter "NETLOAD" command to load the dll to do debugging.
As you can see, debugging is really easy: simply let Visual Studio to start external program (AutoCAD, in this case) whenever the debugging begins (when you hit "F5"). Then if you have DLL autoloading in place, you are ready to run the code for debugging; or you simply manually load the DLL from the bin folder where the DLL and PDB file locate.
So, I really do not understand what/why is the issue you have and why some kind of "AddIn Manager" has anything to do with the debugging.
Norman Yuan
@b0166408 wrote:when I try to debug the plugin in AutoCAD using the AddIn Manager, ...
If the AddIn Manager you're referring to is this one, then you need to contact the developer, because I don't know anything about it, and probably not many others do either. I did take a quick look at the code and it does appear that it is copying files to (and/or from) the temp folder, but I don't have time to get into it.
Can't find what you're looking for? Ask the community or share your knowledge.