NAV 2016 / Chilkat FTP - dotNet Instantiation

thomas.kraft@gmail.comthomas.kraft@gmail.com Member Posts: 7
edited 2016-10-24 in NAV Three Tier
Hoping someone have messed about with this ftp-library that I've been using quite a few times in the past but never with NAV 201x.

I've copied the ChillkatDotNet45.dll into both Add-ins folders (server/client) and after a service restart the DLL lists on the Dynamics NAV tab of the Assembly List from where I'm assigning the SubType to my FTP variable. So far so good.

01> CLEAR(FTP);
02> FTP.UnlockComponent('...my_key...');

On my first attempt to invoke a method call (line 02), I get this error :

"A DotNet variable has not been instantiated. Attempting to call Chilkat.Ftp2.UnlockComponent in CodeUnit ...."

So i did some searching and found this article explaining that I need to use a constructor to instantiate the assembly before i can start using its methods. Allright then.
The assembly offers me two selections under the 'Constructors' section in the C/AL Symbol Menu. Both named 'Ftp2'.

01> CLEAR(FTP);
02> FTP := FTP.Ftp2();
03> FTP.UnlockComponent('...my_key...');

This time the Constructor assignment fails (line 02) with :

"Cannot load an instance of the following .NET Framework object: assembly.ChilkatDotNet45, Version=9.5.0.62, Culture=neutral, PlublicKeyToken=eb5fc1fc52ef09bd."

I have no clue if this is the result of a deficient assembly or a lack of understanding on my part.
Any assistance is welcome.
regards/tkr

Comments

  • KishormKishorm Member Posts: 921
    Can you double check that the DLL exists in the Add-ins folder for the service? Also, do you have more than 1 service for the database and if so then have you installed in the Add-ins folder for each service?
  • thomas.kraft@gmail.comthomas.kraft@gmail.com Member Posts: 7
    edited 2016-10-24
    Hello Kishorm,

    There's only one service-instance pointing to the database.

    Client has :
    C:\Program Files (x86)\Microsoft Dynamics NAV\90\RoleTailored Client\Add-ins\ChilkatDotNet45.dll

    Server has :
    C:\Program Files\Microsoft Dynamics NAV\90\Service\Add-ins\ChilkatDotNet45.dll
    regards/tkr
  • lhlDKlhlDK Member Posts: 11
    I had this once because when i copied the dll into the addin-directories the file was marked as unsafe. Select properties on the dll-file and check/remove this.
  • thomas.kraft@gmail.comthomas.kraft@gmail.com Member Posts: 7
    edited 2016-10-24
    lhlDK wrote: »
    I had this once because when i copied the dll into the addin-directories the file was marked as unsafe. Select properties on the dll-file and check/remove this.

    Sorry but check/remove .. what? I'm guessing you're not talking about the 'read-only' and 'Hidden' attributes or even the four additional attributes on the advanced page regarding archiving and compression?
    regards/tkr
  • KishormKishorm Member Posts: 921
    @lhlDK is referring to this...

    l2uiv2o4lls3.png
  • No. This checkbox is not available to me, neither on the client, nor on the server.

    I would be curious to see if anyone else (could be bothered) trying this out got the same issue.

    The assembly can be downloaded from this page.

    qwizuw06iy5f.png
    regards/tkr
  • KishormKishorm Member Posts: 921
    You're getting the error because you are copying the 32 bit DLL into the Add-ins under the Service folder. Remember the NST is 64 bit - copy the 64 bit DLL there instead.
  • Kishorm wrote: »
    You're getting the error because you are copying the 32 bit DLL into the Add-ins under the Service folder. Remember the NST is 64 bit - copy the 64 bit DLL there instead.

    This did the trick - Thank's a lot Kishorm.
    regards/tkr
  • KishormKishorm Member Posts: 921
    Great! Please can you select "Yes" on the "Did this answer your question YES/NO?" on my post above so that others can easily find the correct answer to this post.
Sign In or Register to comment.