I needed to debug batch processing in BatchRun.ServerGetTask() method.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh68Ut4wp45DoXm8scXTyPr09O6wFUzF3mdHHXDmFpiA38pE85s0KxEtMibgKJj0A3IuuuDYZIMkSWyGYdkp1YQkXXPs1nrp0vviHqm7N2jPpirVw8KU64vSvR8ke6xHuMZtFqmdThaofY/s1600/batch4.png)
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.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUCK4rd5gv_Ijfy-60RjG0s3YcnVCCHJ-KS1BOlBYF09o8oF4hN0Ssq5LdbEnwfAI4TxufJi35e9u7vs2pPFruBEiSxIco9iUlByH-M_zsoLsN4Cj-Q9cM90YKZpm4dhdbJFsi1hbBVRo/s1600/batch8.png)
Open the class method in question directly frpm xppCIL\Source folder.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQ_Td7TLtCa3VeUrWErIHGXmXOLCnMvs6IuP2YEDRNormZkkI7fXtMGv-ViO9hK70ry_Oh98O7upAlIpFePDMrz1BKEaTAMhiA_YhHe7bU1Vj3i3bHk1YDRofHqqyGUilgVDG3YUg5KRI/s1600/batch5.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDdxdw1TyAgozCgQQ5p_DOjuxlciRSJZdkr_Hf5oVeoQqKJ1nhs_N_te-1H0ZzDAIjih2_l0Al4UpMObauGLl3Q945anNYkFl3qIUh74xiNM1m_SyLeVq3wHftH9E9kro-XBuppQE1irM/s1600/batch2.png)
Start the AOS service.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7JHe9BPmQu7nuA16_S1rFtdlRphrx2Kz8ZOEiZZ3sD_kiSEu92ZzGUzxsAxSwW76sgFnP2KgD9JERN7LMXBusVMV-yCO5Sc9JeaQEPM3V9rmptDPoDr4yY_zyJhwa_bxwkoDItpIgvQc/s1600/batch6.png)
Switch back to Visual Studio and attach to the process. It appeared in a few seconds.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAACK9HaLQGs2C_IfYjaPmxPXET97n0euJc76HlmxjBiLWSwTPIWpOl1ZES-IUhvMfPkof17V3umQLrlK6ehwIl8KoVQsFhqC-JP-qmtDjGlx4NQ1Lqd3E2sQkUDxhKmUJwjxIs1KavV8/s1600/batch7.png)
Then it stopped at the problematic breakpoint.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoSB2QwykCgzooRu8_clDORpCzAxOC4XMbjHwWEVvmwFK_3YydgbsLFM1Ctam1a50ANAyiXgbSWPsY96ac7GK5vGQiGt77moO7iIiUU2DsNKm2nD319FE4XxTPDCIgPHrHj3HxOlkXw0M/s1600/batch9.png)
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.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_qqmu3AaT_RwIL6CB8QIgKS-2GyY4CKq7txLWef1FxtgKE6bx6nO1U08hnBNBqLZeZ-dfxj_mbBSLFHOI94fCBF5Q_MSEEvZXqK5-d7nlVMVYf0mfR0dSFC143gNRqC2dXZ2Cr-AqOdo/s1600/batch9_001.png)
Please, do not place breakpoint; in managed code like I did.
Full MSDN article about debugging in AX 2012.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh68Ut4wp45DoXm8scXTyPr09O6wFUzF3mdHHXDmFpiA38pE85s0KxEtMibgKJj0A3IuuuDYZIMkSWyGYdkp1YQkXXPs1nrp0vviHqm7N2jPpirVw8KU64vSvR8ke6xHuMZtFqmdThaofY/s1600/batch4.png)
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.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUCK4rd5gv_Ijfy-60RjG0s3YcnVCCHJ-KS1BOlBYF09o8oF4hN0Ssq5LdbEnwfAI4TxufJi35e9u7vs2pPFruBEiSxIco9iUlByH-M_zsoLsN4Cj-Q9cM90YKZpm4dhdbJFsi1hbBVRo/s1600/batch8.png)
Open the class method in question directly frpm xppCIL\Source folder.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQ_Td7TLtCa3VeUrWErIHGXmXOLCnMvs6IuP2YEDRNormZkkI7fXtMGv-ViO9hK70ry_Oh98O7upAlIpFePDMrz1BKEaTAMhiA_YhHe7bU1Vj3i3bHk1YDRofHqqyGUilgVDG3YUg5KRI/s1600/batch5.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDdxdw1TyAgozCgQQ5p_DOjuxlciRSJZdkr_Hf5oVeoQqKJ1nhs_N_te-1H0ZzDAIjih2_l0Al4UpMObauGLl3Q945anNYkFl3qIUh74xiNM1m_SyLeVq3wHftH9E9kro-XBuppQE1irM/s1600/batch2.png)
Start the AOS service.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7JHe9BPmQu7nuA16_S1rFtdlRphrx2Kz8ZOEiZZ3sD_kiSEu92ZzGUzxsAxSwW76sgFnP2KgD9JERN7LMXBusVMV-yCO5Sc9JeaQEPM3V9rmptDPoDr4yY_zyJhwa_bxwkoDItpIgvQc/s1600/batch6.png)
Switch back to Visual Studio and attach to the process. It appeared in a few seconds.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAACK9HaLQGs2C_IfYjaPmxPXET97n0euJc76HlmxjBiLWSwTPIWpOl1ZES-IUhvMfPkof17V3umQLrlK6ehwIl8KoVQsFhqC-JP-qmtDjGlx4NQ1Lqd3E2sQkUDxhKmUJwjxIs1KavV8/s1600/batch7.png)
Then it stopped at the problematic breakpoint.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoSB2QwykCgzooRu8_clDORpCzAxOC4XMbjHwWEVvmwFK_3YydgbsLFM1Ctam1a50ANAyiXgbSWPsY96ac7GK5vGQiGt77moO7iIiUU2DsNKm2nD319FE4XxTPDCIgPHrHj3HxOlkXw0M/s1600/batch9.png)
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.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_qqmu3AaT_RwIL6CB8QIgKS-2GyY4CKq7txLWef1FxtgKE6bx6nO1U08hnBNBqLZeZ-dfxj_mbBSLFHOI94fCBF5Q_MSEEvZXqK5-d7nlVMVYf0mfR0dSFC143gNRqC2dXZ2Cr-AqOdo/s1600/batch9_001.png)
Please, do not place breakpoint; in managed code like I did.
No comments:
Post a Comment