For a interface to an document management system we need some custom .NET DLL's. But for all theese Dll's I get an runtime error:

In NAV2009R2 we used the same interface and used the DLL's via Automation/Com Interface which worked fine. In NAV2017 we would like to use the dot net classes directly.
I Copied the folders with the requierd DLL's to C:\Program Files\Microsoft Dynamics NAV\100\Service\Add-ins on the dynamics nav Service Tier.
In the development enviroment I created a DotNet variable and then I selected my DLL from the Server Tab in the assemlbies. This worked fine and I can also see all the methods and properties of the classes in both the client and the server, so the DLL is found.
But when I execute the code I always get this error:
This error message I got for both Dll's I tried, one is a PDF Creator DLL for .net from
https://www.pdf-tools.com/pdf20/de/home/ and the other is from the document management system.
The error I got with RunOnClient=Yes and also for RunOnClient=No
When debugging the error already pops up at the line where I try to initialize the variable in C/AL: NewPDFAPIL := NewPDFAPIL.Secure; So it is not a error in a function, already in the initzializing.
I already tried following things and could not solve the problem:
- I installed the DLL directly on the Client in the Addin Folder
- I cleared the temporary cache on both the client and the server with the microsoft dynamics nav addin folder.
- I gave full control rights to users on the folder that contains the dll
- I tried different versions of the product/dll
I am thankful for any help or suggestions
Best Regards
Joshua