With Visual Studio Express 2013 i'm trying to debug AutoCad2010, but it refuses to break the operation, Is it possible to debug AutoCad 2010 with VSE2013? I am using framework 3.5, because AutoCad 2010 doesn't work with 4.5
I have created multiple projects in VSE2008 with AutoCad 2010. That worked fine..
Solved! Go to Solution.
Solved! by wbdehaan. See the answer in context.
finally i found a solution. I downgraded my Visual Basic Express 2013 to Visual Basic Express 2010, and still debugging didn't work at begin. Then I found a solution from Kean Walmsley:
and used solution 2:
"The cause of the problem boils down to the fact that VS 2010 does not choose the right version of the debugger for Class Library projects targeting prior versions of the .NET Framework: it always uses the default version, the debugger targeting v4 of the .NET Framework. This debugger doesn’t see breakpoints in projects targeting older versions of .NET."
Modify the config file of the exe that loads your AddIn (acad.exe.config, revit.exe.config, etc) so that it contains the following just before the
</configuration> <startup> <supportedRuntime version="v2.0.50727" /> </startup>
that worked! Now I can try to do the same when using VBE2013.
Using AutoCad 2010 (installed as 32bit on a 64bit machine, using Windows 7)
thanks for all your effort!
>> i'm trying to debug AutoCad2010, but it refuses to break the operation
How does that "break the operation" look like? Do you get any messages or what happens?
At least yes, the combination of VS2013 Prof. and debug AutoCAD 2010 works well, and so I guess that the Express version does work too.
- alfred -
thank you for your reply!
I will try to explain what i did. first I created a new project, added acdbmgd.dll and acmgd.dll, (with properties copy local: false)
then changed the testproject.vbproj file, and added 2 lines, because this option is not available in the Express edition to start AutoCad:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <StartAction>Program</StartAction> <StartProgram>C:\Program Files (x86)\AutoCAD 2010\acad.exe</StartProgram> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <DefineDebug>true</DefineDebug> <DefineTrace>true</DefineTrace> <OutputPath>bin\Debug\</OutputPath> <DocumentationFile>testproject.xml</DocumentationF
ile> <NoWarn>42016,41999,42017,42018,42019,42032,42036, 42020,42021,42022</NoWarn> <Prefer32Bit>false</Prefer32Bit> </PropertyGroup>
then added some simple code in class1.vb
Imports Autodesk.AutoCAD.Runtime Public Module testModule <CommandMethod("testprog")> Sub main() Dim TempText As String = "Hello World" MsgBox(TempText) End Sub End Module
- pressed 'Start- '-button in VBE: with options on the right of start-button: Debug & Any CPU
- after that AutoCad started automatically,
- in AutoCad I typed netload, and loaded the dll from the \bin\debug\testproject.dll
- when I type 'testprog' in the command-line of AutoCad, the program is started, and gives me 'hello World'-msgbox.
but when I press 'Pause'-button in VBE2013, to debug my code, I get this message:
I tried the option: use managed compatibility mode in Tools > Options
and also Enable native code debugging, but it doesn't work
I Use a 64bit machine with Windows 7, Visual Studio Express 2013, and AutoCad 2010* and AutoCad2014
(* My collegues use AutoCad2010, because I have to rewrite tons of VBA-code)
Hope I explained enough, awaiting your answer,
Wouter de Haan
your path points to AutoCAD 2010 in the x86-programs path, is that really correct (as you are working on a 64bit system)?
>> but when I press 'Pause'-button in VBE2013, to debug my code
Do you press "pause" when the MsgBox is open or later?
What happens if you set a breakpoint at the line where you calling the MsgBox and start then the command?
- alfred -
AutoCad2010 is installed as 32bit version, to be able to use VBA, so yes this is correct. VBE starts AutoCad correctly..
thanks for your assistance, but unfortunately it doesn't work. I added the accoremgd.dll from AutoCad 2014 and added this reference to the project (set copy local false), and then I got 50 errors about the framework incompatability using 3.5 instead of higher. And <CommandMethod("Testprog"> became ambiguous in the autodesk.autocad.runtime namespace.
Is it better to downgrade visual studio to 2012 or maybe 2008 again? Or should it be able to work with debugging?
kind regards, Wouter
accoremgd.dll is only correct for AutoCAD 2013 or 2014, not for AutoCAD 2010.
My question is now: how did you install the 32bit-version of AutoCAD onto your 64bit operating system? Are you using any virtual pc or something similar?
>> Is it better to downgrade visual studio to 2012
At least I don't think that this is necessary, the source or the problem is imho not depending on VS2012 or VS2013.
- alfred -
Hi Alfred & Hallex,
our system-adminstrator installed it using a tool, that makes it possible to install it as 32-bit, because in the 64bit version there is no VBA-support anymore. Therefore it's installed in the program files (x86) directory.
@Hallex : I also tried compiling using framework 4.0 and 4.5, but no success