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 AX (Archived)

Issue in accessing the C# code from X++

(0) ShareShare
ReportReport
Posted on by 1,920

Hi Guys,

I have developed a logic in C# (Dll) and accessing the objects from X++. The server is with TFS version control. I have new server and added the same with TFS version. When I downloaded the codes to the new server, I am receiving an error as

THE METHOD methodname HAS NOT BEEN DECLARED.

I am passing four values for four methods from AX to C#.

Am receiving the error in fourth method.

When I put dot next to the instance name of the C# the method does not comes in the dropdown, when I checked the same in C# solution the method exists.

I have also used .net reflector to open the dll and check for the method, it exists.

Please guide me. Thanks.

*This post is locked for comments

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

    If it's a C# project added to AOT, check whether it's set up for deployment to client, rebuild the project and restart the client.

    If it's an independent assembly, install it into a location where AX can find it.

  • Mohamed Meeran Profile Picture
    1,920 on at

    I tried Martin, but still the issue persists.

    The steps I have followed

    I have opened the project from AOT, cleaned, build and added to AOT.

    Closed AX.

    Copied the assembly in the necessary location.

    Opened AX and compiled the particular class and I have received the same error.

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

    All right, so it's a project in AOT. Then the next question is whether it's set up to deploy the assembly to client. If it isn't, building the project can't deploy anything. If it is, don't try to by yourself, merely verify that it's been deployed (to %USERPROFILE%\AppData\Local\Microsoft\Dynamics AX\VSAssemblies).

    When the deployment is done and if it still doesn't work, we'll move to another phase of analysis.

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Hi meeran,

    Don't forget to read this article to have idea how its being managed

    http://daxmusings.codecrib.com/2011/09/ax-2012-net-assembly-deployment.html

  • Mohamed Meeran Profile Picture
    1,920 on at

    No Martin, it is not. Manually the dll's after building the VS solution are pasted to client and server bin folder. I am doing this for very long time all went fine. When I moved the updated code to another server which has the old code, have received the error only in the updated section of dll. Say unable to access the new method created in C# project from AX. Lists only the old methods.

  • Mohamed Meeran Profile Picture
    1,920 on at

    Thanks Sohaib. But we have tried it and its not working as expected.

  • Verified answer
    Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Why exactly do you waste time doing manually what the system can do for you automatically?

    Anyway, your description reveals that you didn't do the deployment correctly. Verify again that you copied the DLL to a folder where the AX client can find it. Ensure yourself that the old one was overwritten. And don't forget to restart the client.

  • Mohamed Meeran Profile Picture
    1,920 on at

    Thanks Martin.

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

    If your question is answered, please don't forget to mark the answer. So far the thread is still displayed as active.

  • RSolanke Profile Picture
    110 on at

    I have same issue where c# VS project is added to AOT and set is deployed to server and =yes. Its working fine in dev box but  when same model is deployed to other instance i am getting compile error.

    Do i need to manually deploy it after model deployment?

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 AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans