Options

Register dll on Client Machines

eYeeYe Member Posts: 168
Created a dll and registered successfully with regasm runs 100% on my local machine.

Copy dll to customer's test server, register (regasm xl83.dll /tlb), I can compile my codeunit that uses the automation, I can see my functions when I design the codeunit, but during runtime on

IF ISCLEAR(ExcelSheetFormat) THEN
CREATE(ExcelSheetFormat);
This message is for C/AL programmers:
Could not create an instance of the OLE control or Automation server identified by
GUID={904B2CAB-EA6B-4171-8177-994AFE7A144A} 1.0:{C058A8CF-2369-3D95-B94A-F7B03F87B2D6}:'xl83'.xl83.
Check that the OLE control or Automation server is correctly installed and registered.

I suspect that it needs installed in the GAC, but server (and user machines) doesn't have gacutil...

Tried writing a custom application that does the following
FileInfo customClass = new FileInfo(args[0]);
new System.EnterpriseServices.Internal.Publish().GacInstall(customClass.FullName);

It doesn't give any errors, but doesn't seem to do anything either.
Kind Regards,
Ewald Venter

Answers

  • Options
    eYeeYe Member Posts: 168
    http://stackoverflow.com/questions/372140/c-sharp-com-dll-do-i-use-regasm-or-regsvr32

    set regasm="C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe"
    set regasm64="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe"

    %regasm% xl83.dll /register /codebase /tlb
    %regasm64% xl83.dll /register /codebase /tlb
    Kind Regards,
    Ewald Venter
  • Options
    ta5ta5 Member Posts: 1,164
    Hi

    Would'nt regsrv32.exe do the job?

    My opinion:
    If you design a dll used as an automation object, you use regsrv32.exe and while designing in visual studio you have to provide a proper com interface. If you design a .NET assembly and want to use it in RTC as .NET Variable, you don't have to register it at all. It just has to be located in the Add-ins directory of the middle tier and of the classic client of you want to compile. At least for 2009 R2 this should be true.

    Regards
    Thomas
  • Options
    eYeeYe Member Posts: 168
    Hi,

    I did write an interface for my class but regsvr32 didnt work.

    Followed all the guidelines in writing a COM visible class for NAV but most posts end with registering the class with gacutil which is not always possible.

    This is for a NAV5.1 installation, quite spoilt with 2009R2 and 2013's interoperability also :wink:

    Regards
    Kind Regards,
    Ewald Venter
  • Options
    ta5ta5 Member Posts: 1,164
    Additional info to my first post:

    I have built a DLL for NAV 5.0, using good old VB6, without using regasm on the target clients, instead used regsrv32.exe. In VB6 I had to comment each function with the DispId() property.

    Hope this helps.

    Thomas
  • Options
    eYeeYe Member Posts: 168
    Does dependencies on other libraries in your's make a difference?
    I am using Microsoft.Office.Interop.Excel amongst others.

    Will keep it in mind and give it a try though, thanks!
    Kind Regards,
    Ewald Venter
  • Options
    ta5ta5 Member Posts: 1,164
    My dll had dependencies on a 3rd party dll, but it's quite some time ago...
  • Options
    TiniusTinius Member Posts: 8
    I also experienced this dll hell, and the thing that helped me, was targeting the V4.0 framework rather than v2.0.50727, though the .NET project was targeted to v3.5

    in command prompt do the following:
    uninstall Your previous version with regasm /u xxx.dll
    then:
    cd C:\Windows\Microsoft.NET\Framework\v4.0.30319 (or whatever the actual v4 build number is)
    and
    regasm "C:\Install\NAVcomToDoSmth.dll" /TLB:"C:\Install\NAVcomToDoSmth.tlb" /codebase

    The dll worked without even adding it to the GAC.

    Hope this helps to anyone.
Sign In or Register to comment.