.NET

Reply
*Expert Elite*
Alfred.NESWADBA
Posts: 8,888
Registered: ‎06-29-2007
Message 11 of 18 (238 Views)

Re: Debug using Visual Studio Express 2013 and AutoCad 2010/2014

03-20-2014 09:30 AM in reply to: wbdehaan

Hi,

 

may I come back to  that question from post 4 in this thread?

>> What happens if you set a breakpoint at the line where you calling the MsgBox and start then the command?

Does it stop or does it ignore the breakpoint?

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Valued Contributor
wbdehaan
Posts: 64
Registered: ‎11-01-2001
Message 12 of 18 (227 Views)

Re: Debug using Visual Studio Express 2013 and AutoCad 2010/2014

03-20-2014 11:40 PM in reply to: Alfred.NESWADBA

Hi Alfred, 

 

it ignores the breakpoint completely.

f.y.i.: It starts the correct (debug)-dll, because when I stop the running project and change the text in the messagebox and rerun the netload command in AutoCad, it shows the change in text, therefore i'm sure it's not loading a different dll.

 

kind regards, Wouter

*Expert Elite*
Alfred.NESWADBA
Posts: 8,888
Registered: ‎06-29-2007
Message 13 of 18 (204 Views)

Re: Debug using Visual Studio Express 2013 and AutoCad 2010/2014

03-23-2014 07:23 AM in reply to: wbdehaan

Hi,

 

I'm sorry not to have any more ideas what I can do from the distance.

Maybe playing with the ACAD.EXE.CONFIG might be a help, but I have not the environment with a ACAD2010x32 installed on a 64bit OD. The only thing I can say is that development/debugging in Win7x64 with VS2013 and Civil3D2010 (which is 32bit as there was no 64bit version availaible) does work well.

 

Sorry, - alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Valued Contributor
wbdehaan
Posts: 64
Registered: ‎11-01-2001
Message 14 of 18 (190 Views)

Re: Debug using Visual Studio Express 2013 and AutoCad 2010/2014

03-23-2014 11:50 PM in reply to: Alfred.NESWADBA

Hi Alfred, 

 

thanks for your effort, I will try to install a previous version of VBE (because debugging Autocad2010 with VBE 2008 worked well), or maybe try the installation on a different computer)

 

kind regards, Wouter

Valued Contributor
wbdehaan
Posts: 64
Registered: ‎11-01-2001
Message 15 of 18 (180 Views)

Re: Debug using Visual Studio Express 2013 and AutoCad 2010/2014

03-24-2014 06:51 AM in reply to: wbdehaan

Hi Alfred, 

 

When I use autoCad 2014 (64bit installed on 64Bit machine) and VBE 2013, i'm still not able to debug...and it seems like the project isn't loaded, when I use netload in AutoCad.

 

tried:

- http://through-the-interface.typepad.com/through_the_interface/2013/11/debugging-autocad-using-visua...

  1. Turn on “Use Managed Compatibility Mode” via Tools –> Options –> Debugging.
  2. Turn on “Enable native code debugging” from Project –> Properties –> Debug.

 

also tried:

- Loading accoremgd.dll, then it gives lot's of warnings:

Warning 1 The primary reference "accoremgd" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework. testproject

> tried rebuilding project:

 

maybe there's a solution to this, and otherwise i'll ask the system operator for installing an older version of VBE, 2012 or maybe back to the working 2008 version. Thanx in advance,

 

kind regards, Wouter

*Expert Elite*
Alfred.NESWADBA
Posts: 8,888
Registered: ‎06-29-2007
Message 16 of 18 (166 Views)

Re: Debug using Visual Studio Express 2013 and AutoCad 2010/2014

03-24-2014 09:30 AM in reply to: wbdehaan

Hi,

 

can you upload a (small) sample project?

I try to start this on my system, do the corrections, if necessary, and send it back ... for you to try.

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Valued Contributor
wbdehaan
Posts: 64
Registered: ‎11-01-2001
Message 17 of 18 (149 Views)

Re: Debug using Visual Studio Express 2013 and AutoCad 2010/2014

03-25-2014 12:17 AM in reply to: Alfred.NESWADBA

Hi Alfred,

 

in this mail there is an attachment with a small "hello world"-msgbox project 

 

When I netload this project (the debug-version), it first gives me a warning about not trusted* project, I choose Load

* added d:\vbet\ to my trustedpaths, but seems like it doesn't read the subdir's inside, so i added the complete path to the dll, that works)

 

security.png

 

then it doesn't start the program, like it does on AutoCad2010. 

 

unknown.png

 

---

 

 

below the added code in de class1.vb, with a breakpoint on 'Dim Temptext ..'

Imports Autodesk.AutoCAD.Runtime

Public Module testModule
    <CommandMethod("testprog")> Public Sub main()
        Dim TempText As String = "Hello World"
        MsgBox(TempText)
    End Sub
End Module

For your information:

- Menu Tools > Options > Debugging > Use Managed Compatibility mode = checked

- Solution Explorer > My Project > Menu Debug > checkbox Enable native code debugging = unchecked

Solution Explorer > My Project > Menu References > add dll Microsoft ActiveX Data Objects 6.1, because of future connection with SQL-server, is not neccessary at this moment,

 

kind regards

 

Wouter

 

 

 

 

Valued Contributor
wbdehaan
Posts: 64
Registered: ‎11-01-2001
Message 18 of 18 (129 Views)

Re: Debug using Visual Studio Express 2013 and AutoCad 2010/2014

03-28-2014 04:31 AM in reply to: wbdehaan

Hi Alfred,

 

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:

 

http://through-the-interface.typepad.com/through_the_interface/2010/04/hitting-breakpoints-in-net-cl...

 

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."

 

Solution 2

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!

 

kind regards

 

Wouter

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

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

Ask the Community