.Net Interop troubleshooting
jpof88
Member Posts: 10
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,
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.
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.
0
Comments
-
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)0 -
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?0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions