Hi to all,
I am quite new in developing Client add-in, so I am having many problems due to inexperience.
I am working on a Dynamics NAV2017 with Client and Application server on same machine (single tenant). Using Visual studio enterprise 2015 to develop the C# part. And, guess, I am completely new to C# world too
(anyway I can read and understand the code, even if slowly and using references).
I started watching every video and reading all the posts I found on the Topic, specially Vjeko ones.
So, here it is the problem.
I tried to implement "Jason Down" solution (Thx Jason I understood a lot of theory from that) of a simple windows form, to share data with NAV. Here the topics
jason-down.com/2015/01/01/dynamics-nav-net-add-in-control-with-custom-events-and-eventargs/
I also downloaded the solution and installed in my environment, rebuilding the project and generating the new signed dll. But, running the page I started having problems.
The first one was on page load
It was fired on PetAddin::AddinReady trigger
When I changed all the property of DotNet variables involved (in the functions called after the AddinReady was fired), forcing "Run on client", the problem was solved and the page loaded, sharing some data from NAV ( a table with 2 records) and Framework. This is the result after loading:
Now...the next Step was to press the "Speak" button, hoping the system prompt a NAV message with the "sounds" of the animal (a simple text). The message must be retrieved by .Net part and passed to NAV. Here part of the interface code (the full code is in the first link)
The 2 lines with breakpoint are related to the event I was following.
Here the code on the inner class that handles "button click" (sorry for debugging breakpoint)
Now, pressing on the "Speak" button, I get again the same error of the beginning
But this time I have nothing i can change on NAV side.
Sorry for the bad explanation, I hope it is enough to understand the problem, and, possibly, find a solution
( I bet it is something basic I am missing).
Thanks in Advance
Comments
Solution1:
It look like you didnt place the required dll in Server Add-ins folder. Try placing the pet.dll (or other related dlls) in the folder 'C:\Program Files\Microsoft Dynamics NAV\100\Service\Add-ins', if you want to run the dll by service tier.
Solution2:
If you want to run dlls at client you have to place dll at client add-in folder 'C:\Program Files (x86)\Microsoft Dynamics NAV\100\RoleTailored Client\Add-ins' and go to the property of your object which is calling the .Net dll and change the property 'Run as client' to yes.
Zaid Tariq
Dynamics NAV/365 BC Developer at Dynamics 360
please like / agree / verify my answer, if was helpful.
Agreed with the zaid's solution
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.
Anyway...I read many pages on MSDN and similar, but it is the first time i read about putting dll on dynamics\server folders
Zaid Tariq
Dynamics NAV/365 BC Developer at Dynamics 360
please like / agree / verify my answer, if was helpful.
No.
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.