Book a Demo

Author Topic: debugging addins  (Read 7116 times)

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
debugging addins
« on: February 07, 2014, 09:25:58 pm »
Hi
I am trying to debug my addin -
I have tried attaching to a process and also setting the start up project to ea.exe.
Either way my breakpoints are not getting hit.

Can anyone tell me what I may be doing wrong

Thanks
Using V12

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: debugging addins
« Reply #1 on: February 07, 2014, 10:30:51 pm »
I always use the famous print statement to debug my add-ins. I also have a framework to run the add-in code externally. I simulate the GetTreeSelectedObject by a wrapper to supply a dedicated element.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: debugging addins
« Reply #2 on: February 07, 2014, 10:52:22 pm »
It works for me, so you must be doing something wrong.
I always just attach Visual Studio/SharpDevelop to EA.exe and then it stops at my breakpoints.

What you could check
- Are you running your IDE as administrator (you should)
- Have you build your project in debug mode
- Have you build your project with "Register for COM Interop"

In general you have to make sure that the dll in your Project\bin\debug folder is the one that is used by EA.
You can easily test that by trying to delete it while EA is running. If you succeed then there's another dll that is being used.

Geert

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: debugging addins
« Reply #3 on: February 07, 2014, 11:23:40 pm »
Thanks for the replies

I am definitely obeying all of Geert's points but still no break points

I can display message boxes at the location I am trying to debug and they show up. but this is tedious at best

Anything else I could try?
Using V12

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: debugging addins
« Reply #4 on: February 07, 2014, 11:53:47 pm »
Hi,

which edition of Visual Studio you are using?

If I remember right you need the professional edition for VS 2010 and later. Express doesn't work. There might be a workaround somewhere to get the express edition working for DLLs. Have a look in the community and this forum.

Helmut

Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: debugging addins
« Reply #5 on: February 08, 2014, 12:50:45 am »
I am using VS 2012
I just tried it on a colleagues machine and it works there so there must be something about my setup
Using V12

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: debugging addins
« Reply #6 on: February 08, 2014, 01:11:36 am »
For VS2010 i have to do the following:

http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1295872058/8#8

Quote
I had a similar problem, but it boils down to the fact that if you start the EXE at debug time, VS2010 doesn't know what debugger to use, and it picks the wrong one!

To fix this, create an EA.exe.config file in the same location as EA.exe with this content:

<?xml version ="1.0"?>
<configuration>
 <startup>
   <supportedRuntime version="v2.0.50727" />
 </startup>
</configuration>


Now the start external program way of debugging works again.

~ Colin

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: debugging addins
« Reply #7 on: February 08, 2014, 01:32:22 am »
Hi
Thanks for that
Unfortunately I still cannot debug by running EA from with VS 2012
However I am able to attach to a process >:(
Using V12

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: debugging addins
« Reply #8 on: February 09, 2014, 06:59:19 pm »
Hello!

I had a similar problem.
Try to use SharpDevelop free workspace instead of VSTO. This action solved my problem.

Hope this helps, please update.