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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

how to debug xppIL methods

(0) ShareShare
ReportReport
Posted on by

Hi,

I am getting an error from a code that runs on IL. I am not able to debug such code.

Like the code below. I am getting an error when trying to post sales invoice. I am getting an error when code runs through this code but I am not able to debug the code to figure out the error message.

public static container runServiceOperation(ClassId controllerClassId, container packedController)
{
// Use the runas API to transition to a CLR session
new XppILExecutePermission().assert();
return SysDictClass::invokeStaticMethodIL(classStr(SysOperationServiceController),
staticMethodStr(SysOperationServiceController, runServiceOperation),
[controllerClassId, packedController]);
}

Let me know how to debug the code.

Thanks,

Lakshmi

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,451 Most Valuable Professional on at

    You need to attach Visual Studio to the AOS. Please refer to AX 2012 documentation for details: Debugging in Microsoft Dynamics AX 2012 > Managed Code.

    If the problem isn't specific to CIL, consider simply running the method directly in X and used the usual debugger.

    By the way, please always use Insert > Insert Code (in the rich-formatting view) to paste source code. Among other things, it preserves indentation, making code easier to read. For example:

    public static container runServiceOperation(ClassId controllerClassId, container packedController)
    {
    	// Use the runas API to transition to a CLR session
    	new XppILExecutePermission().assert();
    	return SysDictClass::invokeStaticMethodIL(classStr(SysOperationServiceController),
    	staticMethodStr(SysOperationServiceController, runServiceOperation),
    	[controllerClassId, packedController]);
    }

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 620

#2
André Arnaud de Calavon Profile Picture

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

#3
CP04-islander Profile Picture

CP04-islander 430

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans