How to register .NET Component for use with Navision ?

FrekieFrekie Member Posts: 19
edited 2004-02-03 in Navision Attain
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

Comments

  • DenSterDenSter Member Posts: 8,307
    ok, here's my take on this, from what I remember from reading an introduction to .NET. I'm no wizard in this area by any means, mind you.

    .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.
  • allanohlfsenallanohlfsen Member Posts: 7
    Even 3.6 not being .net enabled, your dll would have to be a com object (OCX or Automation Server) in order to be used from within Navision.
  • ShrekShrek Member Posts: 3
    I am not sure about the .Net stuff but to reregistering a Custom Controls in Navision Financials or Attain you go to Tools Custom Controls. Then click the Control button at the bottom of the form and choose Browse.

    Good Luck.
    There is a God!
  • mortenreeslevmortenreeslev Member Posts: 11
    .NET and COM are two different enviroments ... :roll:

    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
  • mortenreeslevmortenreeslev Member Posts: 11
    Hello folks... :|

    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
    }
  • awiprayitnoawiprayitno Member Posts: 1
    Hi,

    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
  • GoMaDGoMaD Member Posts: 313
    I have been struggeling with the same thing for a while and I have found a solution (maybe it isn't the most correct one, but it worked).

    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
    Now, let's see what we can see.
    ...
    Everybody on-line.
    ...
    Looking good!
Sign In or Register to comment.