AutoCAD Electrical General Discussion

AutoCAD Electrical General Discussion

Active Contributor
Posts: 29
Registered: ‎09-24-2012
Message 1 of 3 (1,187 Views)

Can't debug anymore with VS2010 or VS2012 and Acad 2009

1187 Views, 2 Replies
01-07-2013 08:16 AM



I have problems with debugging my .NET application which I use in Autocad Electrical 2009. Here is the problem:


1. A few weeks ago, I created a .dll file, written in C# in VS2010 (Visual Studio). Everything worked, also debugging (Debug options -> Start external program -> acad.exe).

2. Now, I want to add some code to this .dll file, so I opened the project in VS2012. I added the code and I want to debug. But, when I 'netload' my .dll file in autocad and type my command (defined in my code with 'CommandMethod'), Autocad says "Uknown command".

3. Then I tried another way. I started Autocad the 'normal' way (not from visual studio), netload my .dll file and typed the command and..: It works!!. After that, I attached my VS project to the acad.exe process, typed my command and.. Autocad froze. So, that isn't working either.


It looks like my .dll file is working, but not when I attach VS to Autocad or when I start Autocad through VS.

So, after that, I created a very small program in VS2010 (new project) which only shows a messagebox that says: "Hello Autocad". I started up Autocad the normal way, typed the method and it works. Debugging, not working. The same story when I create the same little program in VS2012.


I read about changing the "acad.exe.config", changing the debugger type and so on, but nothing helps. Can anyone tell me why I can't debug anymore and how to solve this problem?


Maybe the problem is already solved in this discussion by JamieVJohnson2, but what does he mean with the following:


"What I would do...  I would run ACAD normally, and then force load the dll manually (NETLOAD command).  If that is working ok, then I would check the registry entry to see if it is properly mapped for the CURRENT user.  Yep it can be different for every user.


If you didn't make it past the first idea, then possibly the dll, is trying to copy to source the acad dlls (bad mojo), and that causes the Netloading process to abort."



I hope someone can help me.


Kind regards

Active Contributor
Posts: 47
Registered: ‎09-04-2012
Message 2 of 3 (1,161 Views)

Re: Can't debug anymore with VS2010 or VS2012 and Acad 2009

01-08-2013 03:30 PM in reply to: 110000474593

This is actually just a VS question but I think I have you an answer. It happened to me too.


In Visual Studio go to Tools -> Options -> Debugging and almost at the bottom uncheck the option saying "Require source files to exactly match the original version"


If I'm correct, this usually happens when you copy and past your solution between folders/computers.

Active Contributor
Posts: 29
Registered: ‎09-24-2012
Message 3 of 3 (1,153 Views)

Re: Can't debug anymore with VS2010 or VS2012 and Acad 2009

01-09-2013 01:19 AM in reply to: DouceDeux

Thank you for your answer, but it doen't seem to work for me. My post is also moved to the .NET forum, I didn't know that there is a .NET forum. I hope someone can help me because it's very weird and frustrating that I don't work suddenly.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions to get help installing your software.

New AutoCAD Electrical Category!

The AutoCAD Electrical forum has moved into it's very own category page, and can no longer be found within the Additional Product Forums.

Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.