web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

AX 2012 R3 Custom DLL .NET

(0) ShareShare
ReportReport
Posted on by 302
Hi,
 
We use AX 2012 R3 for a while. We want to use .NET DLL in our system to interact with third-party systems. X++ doesn't allow certain operartion but  .NET looks like fine. I am new in this part of DLL so I started to TEST how to do the whole process. For this purpose I implemented and easy JsonManager to Serialize / unserialize data. Here the example below. I taked the DLL and I copied to the bin directory in the client side. I imported from the AOT (referenced). I make a test via job using x++. The execution failed when I called JSONManager::SerializeObjectToJson or JSONManager::DeserializeJsonToObject. I don't know if it is something I have to add to the C# code or I need to compile with a certain .NET version or I need to sign it. Or it is something I did wrong in X++. thank you
 
 
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using Newtonsoft.Json;namespace JSON{    public class JSONManager    {        // Serialize an object to JSON        public static string SerializeObjectToJson(object obj)        {            return JsonConvert.SerializeObject(obj);        }        // Deserialize JSON to an object        public static T DeserializeJsonToObject<T>(string json)        {            try            {                return JsonConvert.DeserializeObject<T>(json);            }            catch (JsonReaderException ex)            {                // Handle JSON parsing errors                Console.WriteLine(/Error parsing JSON: {0}/, ex.Message);                return default(T);            }            catch (Exception ex)            {                // Handle other exceptions                Console.WriteLine(/An error occurred: {0}/, ex.Message);                return default(T);            }        }    }}
 
 
 
 
 
I have the same question (0)
  • Martin Dráb Profile Picture
    239,992 Most Valuable Professional on at
    Please tell us more about the problem than mere "the execution failed". Did you get an exception? If so, what did the message say, what was the exception type and the stack trace?
     
    Which version of .NET Framework have you built your assembly for? Did your X++ job compile correctly?
     
    Also, please post your code once more. This site has a bug that distorts formatting in the first post, but it works in replies.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 445 Super User 2026 Season 1

#2
Subra Profile Picture

Subra 407

#3
Martin Dráb Profile Picture

Martin Dráb 274 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans