AX7 / D365: Build: LabelC.exe exited with code -1

You’re seeing the following error in your build logs?

LabelC.exe exited with code -1

What is the cause of the label compile error?

One issue that can cause this error are duplicates in label files, as two or more rows with the same label id. Like you can see in this example:

NewLabel1=MyText
;New Comment
NewLabel1=AlsoMyTest
;New Comment

The label editor should normally prevent that you enter an id more than once, but as our packages / models are just files in AX 7 / D365 for Finance and Operations, there is a chance those files get changed outside of the editor in Visual Studio.
ax7 Labelc Error -1 Duplicate Label
If you’re using VSTS (or Azure Dev Ops nowadays), a simple merge operation could easily be a source of this error.

How to fix the error?

To get to the bottom of this issue you should check the log file of the label compiler.

At your local VM (the error should also be visible directly in Visual Studio)..

“C:\AOSService\PackagesLocalDirectory\[Your_Model]\CompileLabels.xml”

..or in the log folder of your build machines agent.

Advertisement

You may also like...