As the title of the question indicates I am using Autocad 2013 and Visual Studio 2012. I have installed the ObjectARX 2013 SDK and have built one of the .NET samples - Prompts.csproj for example - and have successfully installed the DLL using NETLOAD. The only problem is that I cannot debug. If I use Visual Studio to attach to the acad.exe process both Autocad and Visual Studio will freeze as soon as I run one of the Prompts.cs commands and attempt to hit a breakpoint.
Visual Studio project settings of interest:
- platform target is Any CPU (I have tried all the options. Same problem)
- Target framework is .NET Framework 4.5
- Referenced DLLs are set to Copy Local = True (I have tried both True and False. Same problem).
Between not being able to reload a .NET DLL without restarting Autocad (because of the well known lack of a NETUNLOAD function), and not being able to debug into my code this is a very challenging development environment. I am blind with both hands tied behind my back. Any suggestions are most appreciated.
Solved! Go to Solution.
>> If I use Visual Studio to attach to the acad.exe process
I never use the "attach to existing process", I have my project settings defined to start AutoCAD when I click onto "start" in my project.
>> Target framework is .NET Framework 4.5
Has to be 4.0
>> Referenced DLLs are set to Copy Local = True
Has to be set to false
Good luck, - alfred -
I'll be damned! That worked. Thanks Alfred. Framework 4 instead of 4.5. Who knew?
FYI In case anyone else is trying to set up an effective development environment there's a nifty little NetReload utility out there that allows one to make rapid code changes and reload your assembly on the fly via a clever workaround to the AppDomain problem. You can't line debug that way, but if you need to quickly try new things and don't want to burn the time to constantly restart Autocad it's pretry neat.
I am doing exactly the sam thing, everything works fine for me, I can step into (F8) but the problem is I can't see what is happening in AutoCAD step by step because it can't be activated or refreshed durind debug. At the end of the run AutoCAD activates and I see the whole process. I want to see step by step what happens each line of code execute. How to do this?
I was debugging my ObjectARX application, then I saw VS and ACAD crash when I want to attach VS debuger to acad , I could not find any solution just might someone else have the same problem I am reporting my case.
After 12 hours struggling with VS and Autocade chekcing all the possible solution I found that when you debug a project that targets accoreconsole (accoreconsole dll is refrenced) in acad you can not debug when you want debug it both VS and ACad crash!!
(By the way I tried to use ACAD in place of accorconsole to debug my dll beacuse ACAD reports loading failuire in netload command but accoreconsole does not report it. One offer to ObjectARX team, it would be nice in the case of failure in loading .net dll acccorecosnsle like ACad ireports exception (the reason that load was not sucessful like security reason or etc)
Start with some of our most frequented solutions to get help installing your software.