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)

How can I execute C++ .dll method on server side method?

(0) ShareShare
ReportReport
Posted on by 30

I have added ImageMagick assembly for .NET (MagickNET.dll) in References in Dynamics AX 2012 and executed some X++ code to convert image format and it worked fine.

Then I moved all the code to a method with RunOn property set to server as I dont want to run it on client side. Now, when I execute the same X++ code it gives me the following errors.

Assembly containing type MagickNet.Geometry is not referenced.

Object 'CLRObject' could not be created

Initially, during testing on client method, I placed .dll file in my .../Client/Bin folder and added reference from my AOT.

Next I placed it in .../Server/.../Bin folder and added reference from my server's AOT and then tested the method with RunOn property set to server but it is not working and gave me the above mentioned errors.

Please help me as I have been working around this issue for a week and could not get any solution.

 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Brandon Wiese Profile Picture
    17,788 on at

    Here are two things you should try.

    If you copied/pasted the .NET assembly from the client\bin to the server\..\bin directory, the original permissions could have been retained and the AOS server's security context could not have permissions to the .NET dll.  Reset the permissions on it to inherited.

    Instancing a .NET object on the server tier requires asserting Code Access Security permissions, like this.

    permission  = new InteropPermission(InteropKind::ClrInterop);

    permission.assert();

    In fact many things that work fine on the client require using CAS permissions, such a file access and direct SQL statement execution.  .NET is definitely one of those things.

    Good luck!

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