Author Topic: Debugging VS2005 and AC2006  (Read 5884 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Debugging VS2005 and AC2006
« on: December 29, 2005, 02:25:59 AM »
Visual Studio VS2003

for AC2005, AC2006

Setup as per Lab 02. If anyone needs a hand, just Yell.

Visual Studio VS2005 EXPRESS Editions
Interactive Debugging for ACAD is not enabled.


Visual Studio VS2005

There is an issue with debugging, and thankfully a work-around.
AutoCAD 2006 was written using the 1.1 version of the .NET framework.
VS2005 uses the 2.xx version.

Because of this mix, we can get what is called a LoaderLock/Deadlock when code is executed inside the unmanaged DllMain of a Mixed Mode DLL..
read <techno> :  http://msdn2.microsoft.com/en-us/library/ms172219.aspx
The  exception Mesasage looks like this :
Quote
LoaderLock was detected
Message: Attempting managed execution inside OS Loader lock.
Do not attempt to run managed code inside a DllMain or image initialization function
since doing so can cause the application to hang.


The Workaround : .. only until AC2007 release hopefully. This ONLY affects interactive DEBUGGING.

Create 2 registry files < text files > and save somewhere easily accessable from a file Explorer.

VS_debug_enable.reg
Code: [Select]
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]
"MDA"="0"
VS_debug_disable.reg
Code: [Select]
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]
"MDA"="1"

Just click the enabler VS_debug_enable.reg whenever you want to work with ACAD2006 < or prior ? >
I reset using VS_debug_disable.reg when I'm finished a session.

PS:
Don't forget to add the path of your ACAD.exe in the Project Properties tab.

Normal F5 debugging should now be accessable without spitting the dummy.


Regards
Kerry

I hope all members have a Safe and Happy New Year !






« Last Edit: December 29, 2005, 02:29:27 AM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Glenn R

  • Guest
Re: Debugging VS2005 and AC2006
« Reply #1 on: December 29, 2005, 06:13:16 AM »
acad.exe.config??????????

Draftek

  • Guest
Re: Debugging VS2005 and AC2006
« Reply #2 on: December 29, 2005, 08:03:50 AM »
Yeah, I just received VS2005 yesterday. Wish I had seen this before I started getting realllyyyy upset.

I wound up just turning LoaderLock off in my IDE settings.

Draftek

  • Guest
Re: Debugging VS2005 and AC2006
« Reply #3 on: December 29, 2005, 08:31:09 AM »
Found it by brute force:

From the toolbars:
Debug->Exceptions->Managed Debugging Assistants-> uncheck LoaderLock.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Debugging VS2005 and AC2006
« Reply #4 on: December 29, 2005, 08:51:54 AM »
interesting .. that stops the exception reporting for the error.

the registry key disables the managed debugging assistant (MDA) ..

I wonder if they are essentially the same thing ? The error is caused by several threads locking, and I wonder about the consequences of actually ignoring that.
 
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Debugging VS2005 and AC2006
« Reply #5 on: January 04, 2006, 12:17:12 PM »
Draftek ,

I have been advised that your posted solution < setting from the IDE> and modifying the registry are essentially the same workaround.

Although .. I'm not convinced that this is true in all respects, one difference is that the IDE settings are solution specific.

I've decided to change the setting from the IDE , untill/unless convinced otherwise.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Draftek

  • Guest
Re: Debugging VS2005 and AC2006
« Reply #6 on: January 04, 2006, 03:09:20 PM »
Thanks for the update.

Also, doesn't the registry edit turn off ALL MDA's?