📜 ⬆️ ⬇️

Debugging C # code in AutoCAD using Visual Studio 2012

Recently I started working on creating a plug-in for AutoCAD 2009. I am writing in C #. I use Visual Studio 2012 Ultimate. Since the inclusion of debugging code when writing plug-ins under AutoCAD is associated with certain difficulties and, accordingly, wasting time searching for a solution, I decided to share my experience and provide step-by-step instructions on how to enable debugging in Visual Studio.

My project uses .NET Framework 3.5.


The acad.exe.config file is not necessary to change.



So let's start:
Step 1.
Add an existing project to Solution by specifying the acad.exe file (I have it located at C: \ Program Files \ AutoCAD Architecture 2009 \ acad.exe).

')


Step 2.
Assign an acad project to a start project.


Step 3.
In the properties of the acad project, the Debugger Type property is set to Managed (v3.5, v3.0, v2.0).




Step 4.
After starting debugging (F5), AutoCAD will start. We load our assembly by typing the command NETLOAD on the AutoCAD command line and selecting our dll - ku.


We start our plugin and see that Visual Studio interrupts the execution of the program at the specified breakpoints.


Everything is working!

Source: https://habr.com/ru/post/164305/


All Articles