
180 S.E.2d 818 (1971)
N. C. MONROE CONSTRUCTION COMPANY
v.
GUILFORD COUNTY BOARD OF EDUCATION.
No. 27.
Supreme Court of North Carolina.
May 12, 1971.
*820 McLendon, Brim, Brooks, Pierce & Daniels by Hubert Humphrey, Greensboro, for plaintiff-appellee.
Douglas, Ravenel, Hardy & Crihfield by John Hardy, Greensboro, for defendant-appellant.
LAKE, Justice.
This action was instituted and the pleadings were filed prior to the taking effect of the present Rules of Civil Procedure. Consequently, a demurrer, now abolished by Rule 7, was then the proper vehicle by which to assert the absence of a necessary party and the failure of the complaint to state a claim upon which relief can be granted, these being now asserted in the answer or by motion. See Rule 12(b).
Rule 57 of the Rules of Civil Procedure, relating to declaratory judgment, provides:
"The procedure for obtaining a declaratory judgment pursuant to article 26, chapter 1, General Statutes of North Carolina, shall be in accordance with these rules, and the right to trial by jury may be demanded under the circumstances and in the manner provided in Rules 38 and 39. The existence of another adequate remedy does not preclude a judgment for declaratory relief in cases where it is appropriate. The court may order a prompt hearing of an action for a declaratory judgment and may advance it on the calendar." (Emphasis added.)
The present Rules of Civil Procedure apply to all actions and proceedings pending on January 1, 1970 as well as to actions and proceedings commenced on and after that date. Session Laws 1969, c. 803, § 10. Thus, the present rules apply to this action. Consequently, by the express provision of Rule 57, supra, the defendant's contention that its demurrer to the complaint, for failure to state facts constituting a cause of action for declaratory relief, should have been granted because the plaintiff has a proper remedy other than declaratory relief, namely, injunction, has no merit now, assuming that originally it did have merit.
Rule 19(a) and (b) of the Rules of Civil Procedure provides:
"(a) Necessary joinder.Subject to the provisions of Rule 23, those who are united in interest must be joined as plaintiffs or defendants; * * *
"(b) Joinder of parties not united in interest.The court may determine any claim before it when it can do so without prejudice to the rights of any party or to the rights of others not before the court; but when a complete determination of such claim cannot be made without the presence of other parties, the court shall order such other parties summoned to appear in the action."
The Declaratory Judgment Act provides that courts of record, within their respective jurisdictions, shall have power to declare *821 rights whether or not further relief is or could be claimed and such declarations have the effect of a final judgment or decree. G.S. § 1-253. It further provides that any person interested under a written contract or whose rights are affected by a statute or contract may have determined any question of construction or validity arising under the statute or contract and may obtain a declaration of rights thereunder. G.S. § 1-254. With reference to the parties to an action for declaratory judgment, the Act provides: "When declaratory relief is sought, all persons shall be made parties who have or claim any interest which would be affected by the declaration, and no declaration shall prejudice the rights of persons not parties to the proceedings." G.S. § 1-260.
In Morganton v. Hutton & Bourbonnais Company, 247 N.C. 666, 101 S.E.2d 679, Justice Johnson, speaking for the Court with reference to an action for declaratory judgment, said: "Whenever, as here, a fatal defect of parties is disclosed, the Court should refuse to deal with the merits of the case until the absent parties are brought into the action, and in the absence of a proper motion by a competent person, the defect should be corrected by ex mero motu ruling of the Court." See also: Edmondson v. Henderson, 246 N.C. 634, 99 S.E. 2d 869; Peel v. Moore, 244 N.C. 512, 94 S.E.2d 491. In the Morganton case the plaintiff contended that a deed from the defendant's former cotenants, properly interpreted, divested those persons of all title to and interest in the property involved in the action. The Court said that the heirs or successors in interest of those grantors were entitled to be heard on the question of the interpretation or construction of their predecessors' deed and, therefore, should have been made parties to the action, notwithstanding the provision in G.S. § 1-260 that "No declaration shall prejudice the rights of persons not parties to the proceeding." As to such parties the Court said: "When, as here, decision requires the construction of former legal documents, vitally affecting the rights of several persons, some parties to the action and some not, can it be said with assurance of verity that the lower court may proceed to adverse judgment and the appellate court to affirmation without prejudice to the rights of those not made parties?"
In Edmondson v. Henderson, supra, Justice Johnson, again speaking for this Court in an action for a declaratory judgment, said:
"In Gaither Corp. v. Skinner, 238 N.C. 254, 256, 77 S.E.2d 659, 661, the Court said, quoting from McIntosh, North Carolina Practice and Procedure, Sec. 209, p. 184: `Necessary or indispensable parties are those whose interests are such that no decree can be rendered which will not affect them, and therefore the court cannot proceed until they are brought in. Proper parties are those whose interests may be affected by a decree, but the court can proceed to adjudicate the rights of others without necessarily affecting them, and whether they shall be brought in or not is within the discretion of the Court.'
"In Equitable Life Assurance Society of United States v. Basnight, 234 N.C. 347, 352, 67 S.E.2d 390, 394, it is said: `The term "necessary parties" embraces all persons who have or claim material interests in the subject matter of a controversy, which interests will be directly affected by an adjudication of the controversy. * * * A sound criterion for deciding whether particular persons must be joined in litigation between others appears in this definition: Necessary parties are those persons who have rights which must be ascertained and settled before the rights of the parties to the suit can be determined.'
"In Garrett v. Rose, 236 N.C. 299, 307, 72 S.E.2d 843, 848, it is said: `A person is a necessary party to an action when he is so vitally interested in the controversy involved in the action that a valid judgment cannot be rendered in *822 the action completely and finally determining the controversy without his presence as a party.'

* * * * * *
"[C]onceding without deciding that the practice as to parties may be somewhat liberalized under the Declaratory Judgment Act, nevertheless where it appears, as here, in a case involving the construction of a will that the absence of a necessary party prevents the entry of a judgment finally settling and determining the question of interpretation, we think the court should refuse to deal with the merits of the case until the absent person is brought in as a party to the action. * * *."
In Hine v. Blumenthal, 239 N.C. 537, 80 S.E.2d 458, the action was for a declaratory judgment to determine whether a portion of an alley might be closed. Speaking through Justice Denny, later Chief Justice, this Court held that while the plaintiffs could release their own easement rights in the alley, their release would not affect the obligation of the owner of the servient estate with respect to such owner's responsibility to the defendants, if any, in connection with such alley, and, therefore, the owners of the fee in the alley, subject to the easement, were necessary parties to the proceeding.
In 22 Am.Jur.2d, Declaratory Judgments, § 80, it is said:
"While persons not parties to a proceeding for a declaratory judgment would not be bound by the judgment, it has been held that judgment should not be entered in their absence if they have such an interest in the controversy that their rights would be prejudicially affected by the judgment."
To the same effect, see: 3 Strong, N.C. Index 2d, Declaratory Judgments, § 2, and Annot., 71 A.L.R.2d 723, § 10.
In City of Louisville v. Louisville Auto Club, 290 Ky. 241, 160 S.W.2d 663, the plaintiff brought declaratory judgment proceedings to obtain a declaration that a parking meter ordinance of the city was invalid and, consequently, a contract for the installation of meters was also invalid. The court held that it could not pass upon the validity of the contract, since the person contracting with the city for the installation of the meters had not been made a party. In Weissbard v. Potter Drug & Chemical Corp., 6 N.J.Super. 451, 69 A.2d 559, aff'd 4 N.J. 115, 71 A.2d 629, the court refused to declare a "fair trade" contract abandoned and so void in a proceeding to which the retailer with whom the defendant had made the contract was not a party. In Brewer v. Brasted, 11 Pa.Dist. & Co.R. 103, a contract for the erection of a school building was alleged to be invalid because the school board was not legally constituted. The court declined to enter a declaratory judgment because the other party to the contract was not a party to the action and so had not been given an opportunity to be heard.
The purpose of the present action is to obtain a declaration that the contract between the defendant and Barker-Cochran is invalid. While Barker-Cochran, not being a party to this action, would not be legally bound by a judgment rendered herein, as a practical matter, its rights, if any, under the contract with the defendant would be adversely affected by a declaration such as the plaintiff seeks in this action. Furthermore, if the plaintiff should prevail in this action, the defendant, though forbidden by the judgment of the court to perform its contract, might well be sued for nonperformance by Barker-Cochran. Clearly, Barker-Cochran is a necessary party in a proceeding to declare its contract with the defendant invalid and the court below could not properly determine the validity of that contract without making Barker-Cochran a party to the proceeding.
Without expressing any opinion as to the merits of the contentions of the plaintiff, the judgment of the Superior Court is, therefore, vacated and the matter is remanded to the Superior Court in order that *823 Barker-Cochran may be made a party and, thereupon, further proceedings in accordance with law may be had.
In oral argument before this Court, in response to a question by the Court, we were advised that the Southern High School building has been completed and paid for and is now occupied for school purposes by the defendant. This does not appear in the record before us. We express no opinion as to whether, if these things be true, the present proceeding is moot, the merits of the case not being before us by reason of the absence of Barker-Cochran, a necessary party, from the proceeding.
Reversed and remanded.
