Cleaning up after AxBuild.exe

So the AxBuild.exe tool has been around for a couple of weeks now and imho this is the best addition that a CU brought until now.

There have been some nice post about how it works and what you should keep in mind:

Though the tool is fantastic, we noticed that after performing a compile we always needed some manual actions to get the error count to 0.
Due to the limitations of AxBuild we always had approximately 100 errors left after compiling. A lot of them were custom .Net assemblies that could not be referenced at compile time.

So here is what you normally do when performing a full compile now:

  • AxBuild your environment
  • Import the HTML compiler output
  • In the compiler windows, select create project to create a project with all of the objects that were still invalid
  • Compile the project inside the Ax client

Well, just to make it easier, I have created a little tool which does the last 3 actions at once so that we do not need to perform these things manually. (And enabling us to incorporate it in automated builds).

The idea is to have a startup command which I can use like this :

ax32.exe -startupCmd=importandcompileaxbuildlog_<Full path to the exported compiler log file>

Due to the nature of the (imho not so good) design of the startup commands, it is not possible to enter a file path with spaces in your command prompt. Also putting quotes around it wouldn’t help too.
Therefor I have used the ‘*’ sign and the startup command will replace the ‘*’ charaters with spaces. For example:

ax32.exe -startupCmd=importandcompileaxbuildlog_C:\Program Files\Microsoft*Dynamics*AX\60\Server\AX60R2\Log\AxCompileAll.html

If you want to try it yourself, you can find an XPO containing the code here.