.Net DLL as a automation variable - No class shown in selection

StrewStrew Member Posts: 4
Dear Community,

i got a question about using .Net DLL's in Navision Classic Client.


I wrote a test dll for testing how to implement da dll file into navision,
that it is able to use as automation variable.

Picture of my C# class (developed in .net 4.5.2)


j1zEdAf.png

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I added my dll with regasm and into the gac with following commands:


"C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" "C:\Users\Jean-Pierre.Schmidt\Documents\Visual Studio 2015\Projects\DemoDLLA\DemoDLLA\bin\Release\DemoDLL.dll" /tlb:"C:\Users\Jean-Pierre.Schmidt\Documents\Visual Studio 2015\Projects\DemoDLLA\DemoDLLA\bin\Release\my.tlb"

"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe" /i "C:\Users\Jean-Pierre.Schmidt\Documents\Visual Studio 2015\Projects\DemoDLLA\DemoDLLA\bin\Release\DemoDLL.dll"

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here you can see how it looks like, when i selected my DLL.



qDbugCF.png


#Edit: Strong Name is given to file via key file created from visual studio commandline.


I hope you can help me and give me some advices what I've did wrong.

Kind Regards,
Strew









Best Answer

Answers

  • archer89archer89 Member Posts: 337
    Use .net 2 or 3.5 to register the dll instead of 4.
    best regards
    Franz Kalchmair, MVP
    Alias: Jonathan Archer

    please like / agree / verify my answer, if it was helpful for you. thx.
    Blog: http://moxie4nav.wordpress.com/
  • StrewStrew Member Posts: 4
    With .Net 3.5 and 2.0 it isn't working, too.

    Any other suggestions?
  • zohaibu95@hotmail.comzohaibu95@hotmail.com Member Posts: 223
    edited 2016-12-14
    You simply need to post the dll in this folder:

    C:\Program Files (x86)\Microsoft Dynamics NAV\**\RoleTailored Client\Add-ins

    Where ** is your version no of dynamics nav. Like in case of 2013R2 it is 71 etc.

    By adding this, you will be able to see the dll in navision.

    Once the DLL is available there you can go in NAV make a new Datatype of DotNet and there you will find your DLL with all Methods you have declared in C#.

    Let me know if you have any other question.
    Best Regards
    Zohaib Ahmed
    Dynamics NAV ERP Technical Consultant.

    please like / agree / verify my answer, if it was helpful for you. thanks.
  • StrewStrew Member Posts: 4
    edited 2016-12-15
    Dear zohaibu95,

    i've already tried this, but i read that this feature using addin folder ist
    for RT Client
    . I'm not a specialist, if I'm wrong please correct me.

    Here is the file:
    pjzlDJv.png

    Finding my DLL and Class is working fine, but using it throws this error:
    JkfxDqJ.png


    Translated Error: The .NET-Interoptyp can not be used for the code in the classic CSide-Runtime. :/


    Look here, this guy has the same version & same problem with AddIn Folder:
    http://forum.mibuso.com/discussion/51054/the-net-interop-type-cannot-be-used-in-code-for-the-classic
  • StrewStrew Member Posts: 4
    Thaaaaaanks. It works like a charm.

    My Failure was that i didn't checked the checkbox -> "Com-DLL visible" and the display ID over the function
Sign In or Register to comment.