Showing posts with label aos. Show all posts
Showing posts with label aos. Show all posts

Wednesday, November 16, 2016

Automate Error 351

From time to time we get the lovely CIL compilation Error:351. As suggested by many, for example, by André Arnaud de Calavon, we have to recreate XppIL folder with all its guts.

The sequence is the following (quotation)

1. Stop the AOS.
2. Rename the XppIL folder (C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin\XppIL) to e.g. XppIL_old.
3. Start the AOS.
4. Perform a full CIL generation.
A new XppIL folder will be created when you start the AOS.
When the CIL has completed without problems, you can delete the renamed XppIL_old folder.

Clean and simple. However, I am too impatient to wait for the end of deleting this huge folder: Windows Explorer starts time estimation and it drags on.

So, I wrote two short batch files that can be run as administrator and spare your time and nerves.

First just to rename the existing folder.


@echo off
set folder="C:\Program Files\Microsoft Dynamics AX\60\Server\CHR_AX_DEV\bin\"
echo Rename %folder%  XppIL to XppIL_old?
pause
c:
cd %folder% 
ren XppIL XppIL_old
echo %folder%XppIL to  has been renamed to XppIL_old
pause

Second to delete all the files in the 'backed up' folder and its subfolders with no questions and infolog, then to delete the folder itself. As it said here, they must work faster than just removing the folder.

@echo off
set folder="C:\Program Files\Microsoft Dynamics AX\60\Server\CHR_AX_DEV\bin\XppIL_old\"
echo Delete all the files from %folder% and remove the folder?
pause
del /f/s/q %folder% > nul
rmdir /s/q %folder%
echo Folder %folder% removed
pause

The last remarque. Be sure that your service windows account running the AOS in question had Full permission to the C:\Program Files\Microsoft Dynamics AX folder and all its subfolders.

command line

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.

Monday, October 31, 2011

Two tricks about stopping AX service via PowerShell

Generally speaking, it is true for all Windows services but my particular example is about stopping Microsoft Dynamics AX service (AOS) via PowerShell.

As recommended in Deploying customizations across Microsoft Dynamics AX environments white paper, before importing a metadata model store into the target environment, one must stop all AOS instances in it.

First trick is on how to provide the correct name of the service supposed to be stopped.



If you try to use the service name you see in Services, you will fail.

PS C:\Windows\system> Set-Service -name AOS60$01 -status stopped
Set-Service : Service AOS60 was not found on computer '.'.
At line:1 char:12
+ Set-Service  -name AOS60$01 -status stopped + CategoryInfo : ObjectNotFound: (.:String) [Set-Service], Invali dOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.C ommands.SetServiceCommand 

It is evident that the problem is in $ sign. To fix it you can simply quoted it with "'" (not with "!).
PS C:\Windows\system32> Set-Service -name 'AOS60$01' -status stopped

Unfortunately, this command does not work anyway because of an error:

Set-Service : Cannot stop service 'Microsoft Dynamics AX Object Server 6.0$01-a
x2012_std (AOS60$01)' because it is dependent on other services.
At line:1 char:12
+ Set-Service  -name 'AOS60$01' -status stopped + CategoryInfo : InvalidOperation: (System.ServiceProcess.Service Controller:ServiceController) [Set-Service], ServiceCommandException + FullyQualifiedErrorId : ServiceIsDependentOnNoForce,Microsoft.PowerShell .Commands.SetServiceCommand 

Nevertheless, you can stop the service as usual without any issue. I do not why it does not work but I would suggest that one use another commands to stop and start the service, namely:

PS C:\Windows\system32> Stop-Service 'AOS60$01'
WARNING: Waiting for service 'Microsoft Dynamics AX Object Server
6.0$01-ax2012_std (AOS60$01)' to finish stopping...

PS C:\Windows\system32> Start-Service 'AOS60$01'
WARNING: Waiting for service 'Microsoft Dynamics AX Object Server
6.0$01-ax2012_std (AOS60$01)' to finish starting...

It takes its time, be patient!




Tuesday, February 9, 2010

Error 1075: The dependency service does not exist or has been marked for deletion

I do not know why but my Microsoft Windows Server 2003 SP2 unexpectedly refused to restart AOS instance. It gave the error:

Error 1075: The dependency service does not exist or has been marked for deletion.

It is strange because the only thing in the dependcies was Remote Procedure Call (RPC). No events in the logs.

I deinstall the AOS instance and re-install it  with SP2 right away with the same settings without restarting the server. Now it starts fine.