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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

[AX2012] AX32.exe command-line questions.

(0) ShareShare
ReportReport
Posted on by 970

Hello,

1) If I run AX32.exe with the "synchronize" startupcmd, are there logs that are created that I can look at for information and errors? If so, where are they created. I tried running the command with the -logdir parameter and it didn't seem to create any logs in my specified location.

2) I'm trying to setup an automated build / sync script. I run the script through C# in a non-interactive session. When I try to just call the executable with parameters, it works (but it creates a client GUI window of course), but when I run in a non-interactive context it can't create the client GUI window and it seems like it doesn't do anything. Is there a way to run this executable non-interactively? I had read an article by Martin Drab (hello!) about AX32.exe and logging which seemed to suggest that my method of running the utility through C# would work, but apparently it doesn't.

Thanks.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Joris dG Profile Picture
    17,775 on at

    I'm not sure exactly what is going wrong without seeing code or any sort of output. But my build scripts for AX 2012 for TFS run the client executable non-interactively (they are workflow items that run from the TFS build service).

    You can find my source code on the DynamicsBuild project on codeplex: dynamicsaxbuild.codeplex.com

    All the workflow items are coded in C# and perform all functions needed for a build, including synchronize and others. Note how the later version of this code switched a bunch of things to using autorun.xml over the actual command-line arguments, as we found some disturbing inconsistencies in how some of the command-line options perform their task (not the same as manually running or running through autorun.xml).

  • Verified answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    If you use -startupcmd=synchronize, some information is logged to SysExceptionTable. Unfortunately the implementation is not great and errors are not logged, because they stop the whole process. You could simply catch synchronization errors and ignore them (in SysStartupCmdSynchronize class) - then the infolog messages will be logged to SysExceptionTable.

    Making any changes has one big disadvantage - you can't use such a solution in all situations, e.g. if you're building a clear AX environment. But when you choose the path of modifying AX, you can introduce any type of logging you want.

    Using startup commands always requires an AX client and there is no "normal" way how to hide the window (AFAIK). It's not usually the problem because the build runs in its own session (in TFS Build, as a scheduled task and so on). If you really need to do that, I have a hint for you - you can create a new (hidden) Windows desktop (see CreateDesktop) and run AX there. I experimented with it for one application (using its own GUI and secretly calling AX with a startup command) and it worked quite nicely.

  • Florian Hopfner Profile Picture
    2,461 on at

    You could take a look at the AutoRun startup command if it fits your requirements.

    msdn.microsoft.com/.../aa870082(v=ax.50).aspx

  • bdzevel Profile Picture
    970 on at

    unfortunately i can't use the autorun startupcmd.

    Thanks Martin and Joris, that answered my question. I'm not building this for our in-house dynamics AX implementation, so I can't do too much "custom" stuff. I can't rely on users changing the x++ or anything like that. I'll just run this thing interactively, then. It seems my hands are tied.

    thanks again.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans