I recently installed the latest Autocad .NET Wizards, hoping that I would finally be able to debug my plugin. I've been developing with ObjectARX for over a year now. All previous attempts to get the debugger working on my DLL failed and I gave up.
The latest wizard installed OK, but when I followed the example, trouble started when I simply saved the project. Most of the ObjectARX symbols showed red (undefined) until I added references to "Autodesk.AutoCAD.Interop" and "Autodesk.AutoCAD.Interop.Common". These are both in C:\ObjectARX 2011\inc-x64\ The errors went away after adding these two references, but the question remains as to why this was necessary since the wizard should work out of the box as shown in the demos.
After staring debug (F5), AutoCAD starts and I NETLOAD my DLL. My plugin comes up fine, but breakpoints are ignored :-(
I tried some of the solutions on Through the Interface and elsewhere to no avail. Hoping I don't have to give up again :-(
I'm on 64-bit Windows 7, Visual Studio 2010 Pro (4.0.30319) and AutoCAD 2011. I'm developing in Visual Basic.
Hello and thanks for responding.
Yes, I tried just a bare plugin using the wizard supplied template. I'm assuming that's what you mean. That is how I saw the problems I originally described.
It had only the default ObjecARX references defined:
AcDbMgd.dll (C:\ObjectARX 2011\inc\AcDbMgd.dll)
AcMgd.dll (C:\ObjectARX 2011\inc\AcMgd.dll)
the only other non-standard references inserted by the wizard were:
C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationCo
C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFr
Thanks for helping out, really appreciate it. I can't be the only one to have seen this. I spent quite some time searching the forums though, before posting and didn't see anything applicable.
Yes, but you mentioned that you made changes. The questions I asked required specific information. If you look at the properties for those references it will tell you where the file was actually found (or an exclamation mark if not found).
Also, if all you did was add the interop's, those are not adde by default. Those are only needed if you are using COM objects. Perhaps you are converting some existing vba code? When you create a new project, the dialog offers you the opportunity to add additional refrerences. You can check the appropriate boxes.
As far as debugging goes, do you have your project in debug mode? Run the cofig mgr (Debug>Configuration Manager) and set the solution to Debug. When you are ready to debug, run the netload the dll from the Bin/Debug folder. When you are ready to deploy, set it back to Release mode and then distribute the dll version from the Bin/Release folder.
OK, sorry, misunderstood your question. Here is a screenshot of the references after I added the following:
After that all I did was add a command to test breakpoints and execute.
I meant, after you checked your debug settings like I mentioned...assuming you did so. You didn't say what your project settings were.
Can you do debugging with a project not created via wizard? That is, jsut create a plain Windows class Library project and add reference to acdbmgd.dll/acmgd.dll, and write a simple command method and then run debugging. Can you do that?
1. I never used the wizard (and do not feel I ever need it). But I can imagine the reference to COM APIs contained in Autodesk.AutoCAD.Interop and ObjectDBX Common Library is not MUST-HAVE stuff, so by default the wizard may not add reference to them. So, you may need to manaully set reference to the interop assemblies, if you HAVE TO use COM API (do not over-use/abuse them! in many cases, you do not need them, And with C# 4.0 dynamic, you can call COM API without having to have reference to COM API (equivalent to VB's late binding).
2. Lt looks you are targeting .NET 3.x, because reference to PresentationCode.dll 3.0. You need to verify which version of .NET of your AutoCAD 2011 uses by looking into acad.exe.config for something "<<supportedRuntime .... V4.0.../>. If you do not see it or it is commented out, than your AutoCAD 2012 runs on .NET 3.5. Otherwise, it is on .NET 4.0. Then you make sure your project targets the same version of .NET.
3. When targeting .NET 4.0, there is a very annoying issue with AutoCAD using "Fiberworld". Enter "Fiberworld" at AutoCAD command line, if the value is 1, it is oftern the debugging break point would be missed when debugging. You need to enter "NextFilberworld" at command line and then set it to 0. Now you can debug, but AutoCAD's ribbon/menu/toolbar would likely stop working.
Access a broad range of knowledge to help get the most out of your products and services.