The child may be made a party to the action. If the child is a minor and is made a party, a general guardian or a guardian ad litem shall be appointed by the court to represent the child. The child's mother or father may not represent the child as guardian or otherwise. The biological mother, each man presumed to be the father under section 257.55, and each man alleged to be the biological father, shall be made parties or, if not subject to the jurisdiction of the court, shall be given notice of the action in a manner prescribed by the court and shall be given an opportunity to be heard. The public agency responsible for support enforcement is joined as a party in each case in which rights are assigned under section 256.741, and in each case in which the public agency is providing services pursuant to an application for child support services. A person who may bring an action under section 257.57 may be made a party to the action. The court may align the parties. The child shall be made a party whenever:
(1) the child is a minor and the case involves a compromise under section 257.64, subdivision 1, or a lump-sum payment under section 257.66, subdivision 4, in which case the commissioner of human services shall also be made a party subject to Department of Human Services rules relating to paternity suit settlements; or
(2) the child is a minor and the action is to declare the nonexistence of the father and child relationship; or
(3) an action to declare the existence of the father and child relationship is brought by a man presumed to be the father under section 257.55, or a man who alleges to be the father, and the mother of the child denies the existence of the father and child relationship.