Hi -
I have writen a .NET Component (actually a dll file) for use in Navision. I have tried to register it using regasm which correctly enters it in the registry. However ... I am not able to use it in Navision Attain (not even Attain 3.60). Any ideas ?
The error I get is that it is not properly registered. Indeed I can not find it anywhere in the custom controls.
Thanx
0
Comments
.NET stores the necessary files in a Global Assemply Cache, which is just a folder on your hard drive, instead of writing registry entries. Rather than looking in a list of thousands of entries, it only needs to get the right file (doing some type of checksum or something to uniquely identify the file) from that folder.
Also, the machine that you run your .NET program on must have the CLR installed, probably the whole .NET framework. You should be able to get this information on the MSDN website or in one of the public MS newsgroups.
HTH,
Daniel.
RIS Plus, LLC
Good Luck.
When making a .NET component you get an assembly, the metadata of this assembly has to be converted to the registry using the regasm.exe
All related assemblies shall be located in the Navision folder...
Regasm xxx.dll /tlb:xxxx.tlb
In order to see your methods and properties in Navision you'll have to add an attribute to your classes in .NET
C#
using System.Runtime.InteropServices;
.
.
.
[ClassInterface(ClassInterfaceType.AutoDual)]
public class MyClass
{
implementation
}
there are two ways to enable automation server call from Navision :
1. Simple way
Copy your dll to the same folder as your navision program file (where the fin.exe or finsql.exe). Then use regasm to register the dll incl. the tlb file.
2. Hardest way
Create a strong name (use sn.exe), and then add the sn-file to your code. Compile it, and register it using gacutil.exe
I have added a Setup Project to my Solution and in this project I created all the necessary 'Primary Ouput' files.
For the 'Primary Output' files that would create the DLL files I have set the 'Register' property to "vsdrpCOM".
This property has taken care of the registration process for me, so after installation the dll was available from inside Navsion (not only in C/AL Code but also at Run time).
If you do not set this property the dll was available in C/AL Code (as automation variable) but not at run time. (I always got an error that said that an Instance of this automation server could not be created).
Hope this helps.
Greetings
...
Everybody on-line.
...
Looking good!