Friday, January 23, 2015

Breakpoint; in CIL code

I needed to debug batch processing in BatchRun.ServerGetTask() method.

It was a wrong idea to add breakpoint; instruction into a managed code. Of course, after stopping my AOS did not start anymore because of the error:

Just-In-Time debugging this exception failed with the following error: The operation attempted is not supported

The easiest way to recover this problem is to delete the forementioned instruction and recompile CIL, but I have not access to AOT X++ editor anymore.

Alternatevily, as described in How-To-Debug-Managed-Code-In-AX2012, I did catch this breakpoint in Visual Studio during the short period between Starting and Stopped statutes of AOS service.

Launch Visual Studio as administrator.

Open the class method in question directly frpm xppCIL\Source folder.

Start the AOS service.

Switch back to Visual Studio and attach to the process. It appeared in a few seconds.

Then it stopped at the problematic breakpoint.

Pressing F5 each time it stopped there (actually every minute, as it supposed to be for batch processing), I changed my code back and run full CIL.

Please, do not place breakpoint; in managed code like I did.

Full MSDN article about debugging in AX 2012.

Tuesday, January 20, 2015

Fast full compilation in AX 2012

This is just a short batch that runs a full compilation by means of AxBuild with after-run cleaning in AX 2012.

cd "C:\Program Files\Microsoft Dynamics AX\60\Server\CGI_DAX62_DEVTM2_AOS1\bin"
axbuild xppcompileall  /s=01 /altbin="C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin"
@echo to start compilation log import press any key
cd "C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin"
ax32.exe -startupCmd=importandcompileaxbuildlog_C:\Program*Files\Microsoft*Dynamics*AX\60\Server\CGI_DAX62_DEVTM2_AOS1\Log

Do not forget to run it as administrator.

The cleaning requires a project installed as described in the second hyper link.