Author Topic: Object reference not set to an instance of the object  (Read 5158 times)

MrSnow

  • EA User
  • **
  • Posts: 20
  • Karma: +1/-0
    • View Profile
Object reference not set to an instance of the object
« on: March 21, 2019, 11:05:59 pm »
Hi,

Decently new to EA, I am currently working the Geert's Addin Framework, but I am still a bit unsure about how things work.
First of all, I am trying to create an Addin that can generate JSON-schemas based on class diagrams. I have created a simple Addin-class and it is able to create a JSON-schema skeleton. Though when I try to build another project in which I attempt to build a bit more properties on my JSON schema I get the error:

"EA_MenuClick: Object reference not set to an instance of an object."

I know the concept of what this means, but my question is if I can be doing something wrong when build the second project with the same name and trying to run the new Addin in EA? I also get a warning in Visual Studio that reads the following:

There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "UMLToolingFramework, Version=1.0.7010.23027, Culture=neutral, processorArchitecture=x86", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.   

Do I need to go into my Registry Editor and in some way change what addin.dll EA takes in? I am unsure what I am doing wrong and my understanding of how EA accesses its registry and the addin within is still a bit unclear to me...

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13402
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Object reference not set to an instance of the object
« Reply #1 on: March 22, 2019, 12:33:59 am »
You have a null pointer exception in your code, so you should debug your add-in.

To do so, start EA, and then in Visual Studio choose for Debug | Attach to process and then choose EA.exe

Then do whatever you were trying when you got the error.

The processor architecture warning has nothing to with the null pointer exception and can be ignored AFAIK.

Geert

MrSnow

  • EA User
  • **
  • Posts: 20
  • Karma: +1/-0
    • View Profile
Re: Object reference not set to an instance of the object
« Reply #2 on: March 22, 2019, 07:15:20 pm »
You have a null pointer exception in your code, so you should debug your add-in.

To do so, start EA, and then in Visual Studio choose for Debug | Attach to process and then choose EA.exe

Then do whatever you were trying when you got the error.

The processor architecture warning has nothing to with the null pointer exception and can be ignored AFAIK.

Geert


Geert. Thank you!