web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

how to call a method from a .net (C#) dll within Nav C/AL codeunit

(0) ShareShare
ReportReport
Posted on by 5,136

I have a dll I created from .NET (C#) utilizing the .net Framework 4.0.  After testing and making sure the dll works, I copied the dll file into the /Role Tailored Client/add-ins folder in the client pc as well as the /service/add-ins folder of the Nav server.  Then I stopped and restarted the Nav services.

Then in my codeunit, I created an automation variable and found the Dll that I just copied into the respective folders.  Note that I didn't do regasm.

The problem is when I instantiated the variable, I CANNOT find its methods. The dll is supposed to have one method available to me.  I set it up as Public.

Any thoughts? 

*This post is locked for comments

I have the same question (0)
  • Binesh Profile Picture
    7,885 on at

    Hello,

    Read this article How to: Create a Windows Client Control Add-in

  • Suggested answer
    RockwithNav Profile Picture
    8,637 Super User 2025 Season 2 on at

    Hey MBR,

    What I understood is you need to call a Method of the DLL that you created from C# and you want to use this DLL in NAV.

    If this is the case then you simply need to paste the DLL in this folder C:\Program Files (x86)\Microsoft Dynamics NAV\71\RoleTailored Client\Add-ins. 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.

    Good Luck :)

  • mbr Profile Picture
    5,136 on at

    Hello Rockwith Nav,

    I thought so too.  But  i didn't see it when selecting dotnet.  Note,i have registered the dll yet. I just copied into the add-in folder in the RTC and then in the services\add-ins of the server.  BUt i think i need to register still as i don't see it in the test server either when selecting automation or dotnet in the variables section of the codeunit.  I didn't have any problem in my dev pc of course.  SO i am thinking i need to copy the dll in the c:\windows\assembly and then perform a regasm.  HOwever, i am unable to drag and drop the dll into the C:\windows\assembly folder.  Thoughts?

  • mbr Profile Picture
    5,136 on at

    Hello Rockwith Nav,

    You are absolutely right! I stopped bothering with having to register the dll and simply pasted onto the client rtc's addin folder.  THen in the variable declaration, I chose dotnet (as opposed to automation) and clicked onto the dynamics nav tab and there it was, the dll I added into the add-in folder.  Woohoo! So I am good. 'glad I don't have to bother with registration of dll anymore.  Thank you much.

  • Krish Roy Profile Picture
    39 on at

    Yay !!!! It worked. Thank you !!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans