Friday, November 19, 2021

D365 FO Error MSB6006: "LabelC.exe" exited with code -1

Your D365 build pipeline in Azure DevOps exits with a message like this:
##[error]D:\a\1\NuGets\Microsoft.Dynamics.AX.Platform.CompilerPackage\DevAlm\Microsoft.Dynamics.Framework.Tools.BuildTasks.targets(140,5): Error MSB6006: "LabelC.exe" exited with code -1.

The most likely reason for this is that you have duplicate entries in one or more label files.

You can locate, open and even edit your label files directly in DevOps. Just go to Repos > Files and locate your label files in the hierarchy.
Example: Metadata/Model/Model/AxLabelFile/LabelResources/en-US/XXX.en-US.label.txt

Thanks to Johan Persson for sharing his experiences.