Book a Demo

Author Topic: Cant debug addin  (Read 3979 times)

GrahamL

  • EA User
  • **
  • Posts: 111
  • Karma: +2/-0
    • View Profile
Cant debug addin
« on: June 05, 2020, 08:27:58 pm »
Hi
I have been following Geerts how to write an addin
When I try to debug the DLL by attaching to the EA process I am getting 'No symbols loaded' on my breakpoint.

Has anyone come across this before?

Thanks

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Cant debug addin
« Reply #1 on: June 05, 2020, 08:38:33 pm »
Did you compile with the option "Register for COM interop"? (and then restart EA)
That should redirect EA to use your DLL in the bin\debug folder.

When EA is running, you should not be able to compile as the files are then in use.
If that is not the case, and you can build without errors, something is wrong.

Geert

GrahamL

  • EA User
  • **
  • Posts: 111
  • Karma: +2/-0
    • View Profile
Re: Cant debug addin
« Reply #2 on: June 05, 2020, 08:43:05 pm »
Hi
When I build i am getting

1>  C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4878,5): warning MSB3214: "C:\Users\Graham.Labdon\Documents\GNSAddin\bin\Debug\GNSAddin.dll" does not contain any types that can be registered for COM Interop.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Cant debug addin
« Reply #3 on: June 05, 2020, 08:50:20 pm »
Wait, does your add-in even load in EA?
That's the first thing to check.

I'm guessing that isn't the case since EA needs a class that is COM registered.

Make sure you check the "make assembly COM visible" in the assembly info
Then also make a sure your add-in class is public (private classes are not registered in COM)

Geert


GrahamL

  • EA User
  • **
  • Posts: 111
  • Karma: +2/-0
    • View Profile
Re: Cant debug addin
« Reply #4 on: June 05, 2020, 08:58:02 pm »
OK so I got rid of the warnings
but the addin does not run when EA is started and attempting to debug gives me no symbols loaded on breakpoints!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Cant debug addin
« Reply #5 on: June 05, 2020, 09:38:03 pm »
OK so I got rid of the warnings
but the addin does not run when EA is started and attempting to debug gives me no symbols loaded on breakpoints!

What do you see in the add-in manager in EA? Does your add-in show up in the list there?

Geert

GrahamL

  • EA User
  • **
  • Posts: 111
  • Karma: +2/-0
    • View Profile
Re: Cant debug addin
« Reply #6 on: June 05, 2020, 09:40:48 pm »
Hi
My addin appears in the list but is marked as 'error - missing' (0x800401f)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Cant debug addin
« Reply #7 on: June 05, 2020, 09:55:28 pm »
Helpful, isn't it? There's not much advice possible. Start with a scratch simple add-in (Geert's template) and see that this starts up. Then do incremental changes (use git and commit as often as possible). I did that some years ago and that worked after a failure an a night's sleep (never programmed anything before in Windoze!).

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: Cant debug addin
« Reply #8 on: June 05, 2020, 10:45:26 pm »
Yes, it says something is missing.
Most likely cause is that you misspelled the fully qualified name of your add-in class in the registry key.

If your add-in class is something like
Code: [Select]
namespace myNameSpace
{
    public class MyAddinClass
then the registry key value should read

myNameSpace.MyAddinClass

(make sure to copy/paste and not type the name to avoid typos)

Geert

GrahamL

  • EA User
  • **
  • Posts: 111
  • Karma: +2/-0
    • View Profile
Re: Cant debug addin
« Reply #9 on: June 05, 2020, 10:53:06 pm »
That looks like it

Thanks for you help