Method not found: 'UnityEngine.AnimatorControllerParameter.set_name'

This shows up in the log in build mode, but doesn’t happen when I run from the editor

That same message fills up the log

This is the code:

public static class AvatarAnimatorControllerParameters
    {
        static public readonly UnityEngine.AnimatorControllerParameter Property_TotalSpeedPercentile = new UnityEngine.AnimatorControllerParameter();
        static public readonly UnityEngine.AnimatorControllerParameter Property_ForwardBackSpeedPercentile = new UnityEngine.AnimatorControllerParameter();
        static public readonly UnityEngine.AnimatorControllerParameter Property_RightLeftSpeedPercentile = new UnityEngine.AnimatorControllerParameter();
        static public readonly UnityEngine.AnimatorControllerParameter[] allParameters;

        static AvatarAnimatorControllerParameters()
        {
            Property_TotalSpeedPercentile.name = "Property_TotalSpeedPercentile";
            Property_TotalSpeedPercentile.type = UnityEngine.AnimatorControllerParameterType.Float;

            Property_ForwardBackSpeedPercentile.name = "Property_ForwardBackSpeedPercentile";
            Property_ForwardBackSpeedPercentile.type = UnityEngine.AnimatorControllerParameterType.Float;

            Property_RightLeftSpeedPercentile.name = "Property_RightLeftSpeedPercentile";
            Property_RightLeftSpeedPercentile.type = UnityEngine.AnimatorControllerParameterType.Float;

            allParameters = new UnityEngine.AnimatorControllerParameter[] { Property_TotalSpeedPercentile, Property_ForwardBackSpeedPercentile, Property_RightLeftSpeedPercentile };
        }
    }

If I create the AnimatorControllerParameter at runtime I get this instead:
MissingMethodException: Method not found: ‘UnityEngine.AnimatorControllerParameter.set_name’.
at BaseMod.V1.AvatarMovementEffects.Update () [0x00000] in :0

static public UnityEngine.AnimatorControllerParameter Property_TotalSpeedPercentile()
        {
            UnityEngine.AnimatorControllerParameter acp = new UnityEngine.AnimatorControllerParameter();
            acp.name = "Property_TotalSpeedPercentile";
            acp.type = UnityEngine.AnimatorControllerParameterType.Float;
            return acp;
        }