0

I am trying to create a Minitab Add in using COM in C#. I am adding some external reference such as ZedGraph or OxyPlot. But every time it is unable to find dll. enter image description here

If I use dll as embedded resource, then it throws:

external component has thrown an exception

I have tried putting dlls together but still no luck. It would be great if someone help me sort out.

Waqar Ahmed
  • 5,005
  • 2
  • 23
  • 45
  • Can you provide some code; a github repo should be ideal :) – Hackerman May 19 '19 at 12:50
  • @Hackerman Sure, here is the link. https://github.com/waqar-ahmed/TechmaxMinitabAddIn . Im calling the ZedGraph library in BAPlot.cs And AddIn.cs is the file which is initially called by the Minitab, when it loads the dll. – Waqar Ahmed May 19 '19 at 12:55
  • This is a standard mishap when creating a [ComVisible] assembly, the CLR look for dependent assemblies in the normal places. So not the directory where you put your assembly, it looks in the directory where the EXE is stored and in the GAC. Using ILMerge is a standard workaround, but you should do this only after you've debugged your code and figured out the reason for the exception. So just copy the dependent assemblies in the EXE directory until you get there. – Hans Passant May 19 '19 at 13:35
  • @HansPassant Im getting external component has thrown an exception now. – Waqar Ahmed May 19 '19 at 14:01
  • Congratulations, good luck debugging it. – Hans Passant May 19 '19 at 14:04
  • Can you please give any hint how I can debug it? because that dll is being loaded via com in Minitab. – Waqar Ahmed May 19 '19 at 14:58

0 Answers0