Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Suggested answer

how to debug xppIL methods

Posted on by Microsoft Employee

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

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 225,783 Super User on at
    RE: how to debug xppIL methods

    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]);
    }

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,459 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,783 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans