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)

ClrObject static method invocation error calling external dll in AX2009

(0) ShareShare
ReportReport
Posted on by

Hi all

I try to call a external dll (placed in the bin-directory where the AOS is located). The reference in AX is done.

My call looks like the followingprotected boolean createContractList()
{
    InteropPermission   interopPerm;
    Integer             ret;
    ;

    // get CLR interop permission
    interopPerm = new InteropPermission(InteropKind::ClrInterop);
    interopPerm.assert();

    ret = ch.Sirius.FtxWrapper.SwoxWrapper::FTX_CreateContractList(@"\\GFCFS02\BankFiles\CHTA\FTX");

    CodeAccessPermission::revertAssert();

    if (ret != 0)
        return checkFailed("@GFC2440");

    return true;
}:

The class is running on server

Who can help me out?

*This post is locked for comments

I have the same question (0)
  • Dick Wenning Profile Picture
    8,705 Moderator on at

    in case you add it to the global assembly cache, does that help

  • RamerC Profile Picture
    195 on at

    No I did that as well

  • Suggested answer
    Dick Wenning Profile Picture
    8,705 Moderator on at

    when you compile the code, was the ax client running on the server?

    otherwise, the code has never been compiled correctly

    did you add a reference in the AOT

    what is the .net version of the dll?javascript:void(0);

  • RamerC Profile Picture
    195 on at

    Not sure what you mean. I changed the class in Ax from RunOn "Called from"  to "server" and recompiled the class.

    The dll has version 0.0.0.1

  • Dick Wenning Profile Picture
    8,705 Moderator on at

    is the dll base on .net 3.0, 3.5 or higher?

  • RamerC Profile Picture
    195 on at

    I don't know.  It's written from someone else,  already left the company. I'll try to find out and give feedback

  • Community Member Profile Picture
    on at

    One more information (maybe it is related to this)

    the "SwoxWrapper" is built to call functions in a  pascal written dll from external company. Both dlls are placed in Bin-directory on AOS-site. SwoxWrapper is registered in GAC, the original swox dll is not because not possible.

    Server is W2k8 R2 (64bit)

  • Community Member Profile Picture
    on at

    Hi again me...

    What I believe is that it really is a problem with 32/64 bit

    AOS is running on 64bit, the wrapper is built with "AnyCPU" option and the original dll called from the wrapper is 32bit (very old one)

    Is this a possible problem and how can it be resolved?

  • Verified answer
    Brandon Wiese Profile Picture
    17,788 on at

    I answered this in another thread.  I highly recommend you build a web service to host your 32-bit DLL and call this web service from the AOS server tier.

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