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 :
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
    237,807 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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans