Options

.Net Interop troubleshooting

jpof88jpof88 Member Posts: 10
edited 2013-10-24 in NAV Three Tier
Hello guys,

I've been a NAV programmer for a long time but its the first time I ask for help on the forum.

My problem is the following,
I created a .Net dll based on framework 4.0, to extend excel buffer funcionality, and installed it with gacutil utilily on my system.

Then, created a console application to test my dll and everything ran ok.
Next step was to declare the DotNet variable in NAV 2013 and add my code. The object compiled with no problems, but, when I run it, I get the message "Cannot instanciate the following .Net ....." on
"gNAVExcelDecorator := gNAVExcelDecorator.ClassNAVExcelDecorator(Decorator);" line.

So, my code is has follows,
fxSetBorder(VAR Decorator : DotNet "Microsoft.Dynamics.Nav.OpenXml.Spreadsheet.CellDecorator")
//TEMP
lDnetHexBinaryValue := lDnetHexBinaryValue.HexBinaryValue('#FFFF00');
Color := Color.Color;
Color.Rgb(lDnetHexBinaryValue);
Border := XlWrkShtWriter.DefaultCellDecorator.Border.CloneNode(TRUE);
Border.LeftBorder := XlWrkShtWriter.DefaultCellDecorator.Border.LeftBorder.CloneNode(TRUE);
Border.LeftBorder.Color := Color;
BorderStyle := BorderStyle.Medium;
Decorator.Border := Border;

CLEAR(gNAVExcelDecorator);
[b]gNAVExcelDecorator := gNAVExcelDecorator.ClassNAVExcelDecorator(Decorator);[/b]
gNAVExcelDecorator.fxSetLeftBorder(7); // 7 - Medium
Decorator := gNAVExcelDecorator.GetDecorator;
//TEMP

Also tried converting my dll to an add-in, but the result was the same.
I've cracked my head on this one, but can't find the answer for my problem.

Help me please, thanks in advance.

Comments

  • Options
    arnmaarnma Member Posts: 7
    A similar error to this often happens when you only add the DLL to the RTC addin folder, but not to the service addin folder. But since you used gacutil, I'm not sure thats the problem.

    Otherwise I would guess that you have to change set your variable to run on client. (CTRL-F4/properties on the variable/object)
  • Options
    jpof88jpof88 Member Posts: 10
    Well, my testing environment sets client, service, and database all in the same machine, so I presume that, it won't help much. But I'll try.

    By the way, how do server side add-ins work? Where do you register them?
Sign In or Register to comment.