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)

Method has not been declared

(0) ShareShare
ReportReport
Posted on by 524

This is driving me beyond borderline.

I have a 3rd party module with a class that uses a reference to an assembly. When I try to compile the class, I get an error on one of the lines saying that 'the method has not been declared'. Below is the condensed code. Error occurs on the last line.

public server static void UploadToSharepoint(BT_DPA_PackageShowPDFSettings settings)
{
    UploadFileToSharepoint.UploadFile   updsf;
    
    interopPerm = new InteropPermission(InteropKind::ClrInterop);
    interopPerm.assert();
    uploadOk = false;
    try
    {
        updsf =  new UploadFileToSharepoint.UploadFile();
        uploadOk = updsf.DoUploadUsingEXE(tempXMLFile, pdfFile);
        if(!uploadOk)
        {
            error(updsf.get_LastError());
            stackTrace = updsf.get_StackTrace();


The exact same code compiles just fine on the DEV system.

  • I verified that the references exist in both AOT's and that they reference the same version of the assembly.
  • I verified that the assembly in question exists in the GAC of both systems and that it has the same version.
  • I verified with fuslog that the correct assembly (from GAC) is loaded.
  • I rebooted the AOT (3 times to be sure and once for good luck).
  • Purged the xpill folder
  • Purged my local cache
  • Said my prayers.

What am I missing here?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Do you have the dll in the client and server bin folder?

  • Crispin John Augustine Profile Picture
    37,081 on at

    Try typing in upsdf. and look if it Shows any methods in the Dropdown?

    If it doesn't Show any, and that you confirmed your references node in AOT, try adding the reference manually in this machine (not xpo Import)

    On a last but important note, check if it runs in Client/Server, and if the reference is present in the right machine.

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

    If you can create an instance of UploadFileToSharepoint.UploadFile() and call get_LastError(), it seems that the assembly was loaded correctly. Therefore I don't think that the other replies addresses the right problem.

    You mentioned that the assemblies have the same version, but can't they be two assemblies with the same version and different content? Check if their content is really identical (e.g. by calculating hashes and comparing them).

    By the way, you mentioned several things specific to AOS (XppIL, AOS restart), but you don't have to waste time with them, because compilation happens on client.

  • Francesco Profile Picture
    524 on at

    No need for hash calculations. There is 3kb difference between the two files. Right on the mark.

    I didn't actually restart the AOS, I just didn't want anyone suggesting it as a solution. I'm not a great believer in the power of prayer either for that matter.

    Thanks!

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