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 :
Finance | Project Operations, Human Resources, ...
Unanswered

Dll method not found

(0) ShareShare
ReportReport
Posted on by 10

Hello Team,

In my D365 FO project i'm using a .dll reference (CSharp project).

Step I have done 

>>added method as public

>>added reference in AosService\PackagesLocalDirectory\[MyPackage]\bin

it was working fine and i am able to access old methods,

Recently i have added some new methods 

While writing code vs2019 professional Intelligence showing these new methods, 

Now with same configurations Newly added methods not found in x++ classes.

I have tried below with bad luck

->full build of my model + reset iis + refresh .dll,

If anyone have any idea about issue, please share that will be help full.

I have the same question (0)
  • Martin Dráb Profile Picture
    237,892 Most Valuable Professional on at

    What exactly do you mean by "Newly added methods not found in x++ classes"? Are you saying that you see the methods in Intellisense but you get a compilation error when you build your solution or model?

    You didn't mention adding an AOT reference - did you do it?

    What do you mean by "refresh .dll"? Did you compile your C# project and overwrote the assembly in [MyPackage]\bin?

  • Komi Siabi Profile Picture
    13,107 Most Valuable Professional on at

    Hi,

    Did you try adding the C# project as reference to your X++ project from Visual studio?

    Right click project -> add reference then add your C# project and build project.

  • D K Singh Profile Picture
    10 on at

    Hi Martin

    thanks for reply,

    Yes i am getting Intelligence  but while building it gives error.

    By Adding AOT  reference i have done below   (if something else please let me know)

    >>added dll in AosService\PackagesLocalDirectory\[MyPackage]\bin

    >>Added reference in AX Project

    >>Now trying to access dll method in x++ class.

    >>Getting method name in Intelligence but while building it is error

    "refresh .dll"  > yes i have done the same

    I can see method in Object browser too

  • D K Singh Profile Picture
    10 on at

    Yes  did the same

    not  working

  • Martin Dráb Profile Picture
    237,892 Most Valuable Professional on at

    It would help if you give us more details straight away, instead of forcing us to ask for everything.

    What compilation errors are you getting?

    Please show us one of the new methods and how you're calling it in X++.

    What exactly did you do when you "Added reference in AX Project"?

    When I asked what you meant by "refresh .dll", you answered "refresh .dll > yes i have done the same:", which obviously told me nothing. Please try it once more.

    Also, we can't guess what you mean by "Yes  did the same" in your last reply.

  • D K Singh Profile Picture
    10 on at

    Here is the complete simple code

    A simple method in dll 

    pastedimage1663131688336v1.png

    [quote]

    It would help if you give us more details straight away, instead of forcing us to ask for everything.

    What compilation errors are you getting?

    Please show us one of the new methods and how you're calling it in X++.

    What exactly did you do when you "Added reference in AX Project"?

    When I asked what you meant by "refresh .dll", you answered "refresh .dll > yes i have done the same:", which obviously told me nothing. Please try it once more.

    Also, we can't guess what you mean by "Yes  did the same" in your last reply.

    [/quote]

    I have compiled n and build

    >copied Dll in M:\AosService\PackagesLocalDirectory\[MyProjectModel]\bin

    > Added dll reference in AX Project By> Right Click on axproject>AddReference>Browse to M:\AosService\PackagesLocalDirectory\[MyProjectModel]\bin

    Below is  x++ code 

    pastedimage1663132150739v2.png

    Build error in line number 10 

    SumNew(System.int) not found in WrapperDemo.TestService 

  • Martin Dráb Profile Picture
    237,892 Most Valuable Professional on at

    There is no async/await in X , therefore I wouldn't be surprised if you get into troubles with it. Please try a synchronous method returning a task. If it starts working, you'll know that it is the cause.

    By the way, your code for catching the exception is over-complicated. You can get the exception object by this code:

    System.Exception ex;
    
    try
    {
        ...
    }
    catch (ex)
    {
        ...
    }

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans