
490 N.W.2d 256 (1992)
HOMER TOWNSHIP, Plaintiff and Appellant,
v.
Douglas P. ZIMNEY and Lonnie G. Zimney, Defendants and Appellees.
Civ. No. 910367.
Supreme Court of North Dakota.
October 1, 1992.
*257 Buchanan Law Office, Jamestown, for plaintiff and appellant; argued by Daniel E. Buchanan, Jamestown.
Gilje, Greenwood & Dalsted, Jamestown, for defendants and appellees; argued by Charles J. Gilje, Jamestown.
ERICKSTAD, Chief Justice.
Homer Township appealed from a district court judgment declaring its zoning ordinance void for failure to comply with a statutory notice requirement and dismissing its action against Douglas and Lonnie Zimney to enforce the ordinance. We affirm.
The Township sued Zimneys, alleging, in part: (1) that the Township adopted a zoning ordinance on August 3, 1979; (2) that in 1989, Zimneys sought a variance from the ordinance's restrictions on commercial uses; (3) that the variance was denied and Zimneys did not appeal; and (4) that, shortly after the variance was denied, Zimneys "commenced the operation of a salvage yard, keeping numerous pickups and other motor vehicles on their premises, many of which were not operable, and by hauling scrap metal in and out of the premises, all of which was and is prohibited commercial activity in the Township." The complaint sought to enjoin Zimneys' violation of the zoning ordinance, to require Zimneys to bring their premises into conformity with the applicable residential zoning requirements, and to impose a penalty of "$200 a day for every day ... in violation of the Township Zoning Ordinance."
The trial court made the following findings of fact:
"3. That the Zimneys operated a commercial junkyard and automobile repair shop out of their residence located in Homer Township.
"4. That Homer Township has claimed to have established a zoning ordinance regulating the use of the Zimneys' land which prohibits the use of that land for the operation of a commercial junkyard and automobile repair shop....
"5. That notice was not published in the official newspaper of Stutsman County before the meeting at which Homer Township claims to have passed the zoning ordinance.
"6. That Section 58-03-13, N.D.C.C., provides in part that before a zoning ordinance becomes valid and effective, there must be a public hearing with at least fifteen (15) day's notice thereof given by publication in the official newspaper of the county."
The trial court concluded:
"3. That the notice requirements set out in Section 58-03-13, N.D.C.C., are prerequisites for the validity of a township zoning ordinance. Because the notice requirements were not met, Homer Township's purported zoning ordinance is void.
"4. That the enforcement action against the Zimneys should therefore be dismissed."
The Township contends that the Zimneys, "having been neither citizens of the township in 1979, nor parties in interest to zoning proceedings there at the time, *258 may [not] challenge the lack of published notice." We have said that one may appropriately challenge the validity of a zoning ordinance as a defense in an enforcement action. Pulkrabek v. Morton County, 389 N.W.2d 609 (N.D.1986). Thus, the Zimneys may defend themselves against the enforcement action by challenging the validity of the ordinance on the ground that the required statutory procedure was not followed in adopting the ordinance, rendering the ordinance void.
Section 58-03-13, N.D.C.C., which specifies the procedures by which township supervisors may adopt zoning ordinances, provides in part:
"No regulation, restriction, or boundaries shall become effective until after a public hearing thereon at which parties in interest and citizens shall have an opportunity to be heard. At least fifteen days' notice of the time and place of such hearing shall be published in the official newspaper of the county...."[1]
The Township argues that the notice requirement of § 58-03-13, N.D.C.C., is not mandatory, but merely directory.
Procedural requirements contained in state zoning enabling statutes "are regarded as mandatory, and a substantial failure to comply will render an ordinance invalid." C. Rhyne, The Law of Government Operations § 26.22 (1980). "A failure to give the required notice to those affected by a proposed action or those designated by law will render the ordinance invalid." Id. at § 26.28. "A failure to give proper notice of a hearing constitutes a jurisdictional defect." 2 E. Yokley, Zoning Law & Practice § 9.6 (1978). An "ordinance or amendment is invalid for failure to give required notice." 8A McQuillin Mun Corp § 25.249 (3rd ed. 1986). Procedural requirements specified in a state zoning enabling act are "usually regarded as mandatory, and hence a substantial failure to comply with such procedural requirements will render a zoning ordinance invalid." 82 Am.Jur.2d, Zoning & Planning § 47 (1976). A notice and hearing requirement in a zoning enabling act "is mandatory, and the failure of the legislative body to conduct an appropriate hearing, after proper notice thereof, will invalidate the zoning ordinance." Id. at § 49.
"The rule that compliance with the statute is mandatory and jurisdictional has been announced in scores of cases and appears to prevail in every jurisdiction where the question has been presented. It is founded on the premise that local government, having no residual power to zone, is absolutely incapable of doing so except in the manner specified in the statute."
Id. at § 50. "Applicable statutes calling for notice in a particular manner and form preliminary to the adoption or amendment of a zoning law are generally construed as mandatory and jurisdictional so that measures passed in contravention thereof are invalid." Anno., Validity and construction of statutory notice requirements prerequisite to adoption or amendment of zoning ordinance or regulation, 96 A.L.R.2d 449, 461 (1964).
This court's affirmance in Munch v. City of Mott, 311 N.W.2d 17 (N.D.1981), of the trial court's conclusion that the lack of published notice of an application for approval of a conditional use invalidated building permits issued without such notice, is consistent with the foregoing discussion of notice requirements. See also Tilley Properties, Inc. v. Bartow County, 261 Ga. 153, 401 S.E.2d 527 (1991) (A zoning ordinance is invalid if there was no compliance with statutory notice and hearing requirements.); Glaspey & Sons, Inc. v. Conrad, 83 Wash.2d 707, 521 P.2d 1173 *259 (1974) (Zoning amendments were invalid because the notice given was inadequate.); Dodds v. Bickle, 77 S.D. 54, 85 N.W.2d 284 (1957) (Failure to give the notice required by statute renders a zoning ordinance ineffective.).
In light of the foregoing authorities on the effect of failure to publish notice as required by a state zoning enabling act, we conclude that the notice requirement of § 58-03-13, N.D.C.C., is mandatory and that the trial court correctly concluded that the Township's failure to publish the notice required by § 58-03-13, N.D.C.C., renders the purported zoning ordinance void.
We reach the same result by considering the use of the word "shall" in § 58-03-13, N.D.C.C. The statute provides that "[n]o regulation ... shall become effective until after a public hearing thereon" and that "notice of the time and place of such hearing shall be published in the official newspaper." The word "shall" is "generally imperative or mandatory ... excluding the idea of discretion, and ... operating to impose a duty", although "it may be construed as merely permissive or directory (as equivalent to `may'), to carry out the legislative intention." Black's Law Dictionary, 1375 (6th ed. 1990). The word "shall" in a statute ordinarily creates a mandatory duty. In Interest of C.J.A., 473 N.W.2d 439 (N.D.1991); Solen Pub. Sch. Dist. No. 3 v. Heisler, 381 N.W.2d 201 (N.D.1986); In Interest of Nyflot, 340 N.W.2d 178 (N.D.1983). "Courts give effect to the use of mandatory terms such as `shall'" in zoning acts. 3A Sutherland Stat.Constr. § 75.07 (4th ed.). The effect of noncompliance with the notice and hearing requirements of § 58-03-13, N.D.C.C., is that the zoning regulations do not become effective. Here, "there was no compliance, either strict or substantial"[2] [Morgan v. Hatch, 274 N.W.2d 563, 569 (N.D.1979)], and that noncompliance with the mandatory notice requirement is fatal to the township's zoning ordinance.
The Township contends that a number of assertedly curative considerations, such as recording the ordinance with the register of deeds, the issuance of building permits, an absence of prejudice to the Zimneys, an absence of evidence that the Township acted in bad faith, the rights and interests of other homeowners, and the public interest in upholding the actions of local public officials, cure the notice deficiency and validate the ordinance. We disagree.
"[T]here is no common law in any case where the law is declared by the code." Section 1-01-06, N.D.C.C. "The code establishes the law of this state respecting the subjects to which it relates, and its provisions and all proceedings under it are to be construed liberally, with a view to effecting its objects and to promote justice." Section 1-02-01, N.D.C.C. The "law is declared by" § 58-03-13, N.D.C.C., and it is to be construed "with a view to effecting its objects." The object of the notice and hearing requirements of § 58-03-13, N.D.C.C., is to promote widespread opportunity to be heard before a zoning ordinance is adopted by permitting "any person to be heard" because "every citizen should be able to make his voice heard and protest against any ordinance that might be detrimental to the best interests of the city." A Standard State Zoning Enabling Act § 4, fn. 7, cited supra note 1. Overlooking the Township's noncompliance with § 58-03-13, N.D.C.C., would not be "effecting its objects." Because the zoning ordinance was not validly enacted, the township supervisors' "good intentions are for naught." Glaspey & Sons, Inc. v. Conrad, supra, 521 P.2d at 1176.
*260 The Township relies on Pulkrabek v. Morton County, 389 N.W.2d 609 (N.D.1986), for the proposition that it "excuses some noncompliance with strict statutory procedures." In Pulkrabek, documents establishing proof of publication of county zoning ordinances were not indexed in the county auditor's reception book, as required by § 11-13-02(3), N.D.C.C., dealing with the duties of county auditors. The ordinances were published, however, and proofs of publication were filed in a storage vault. We held that that complied with the county zoning enabling act contained in Chapter 11-33, N.D.C.C. The noncompliance with § 11-13-02(3), N.D.C.C., was noncompliance with a general filing duty on the part of a county auditor, it was not noncompliance with a mandatory duty contained in a zoning enabling statute providing that an ordinance will not take effect unless the statute is complied with. The Township's reliance on Pulkrabek is misplaced.
The Township's reliance on City of Fargo, Cass County v. Harwood Twp., 256 N.W.2d 694 (N.D.1977), and Fairmount Twp. Bd. of Supervisors v. Beardmore, 431 N.W.2d 292 (N.D.1988), with regard to protecting other persons who have relied on the ordinance, is also misplaced. In Harwood, this court said: "[A] landowner who has made substantial expenditures in reliance upon existing zoning or otherwise committed himself to his substantial disadvantage before the zoning change may be protected." 256 N.W.2d at 700 (emphasis added.). In Beardmore, we merely observed that vested rights may be protected when zoning ordinances are changed and said: "A showing of injury or destruction of a vested right is required before exemption from the application of an amended ordinance is granted." 431 N.W.2d at 295 n. 4 (emphasis added.). Those cases dealt with changes in zoning ordinances, not with the validity or invalidity of zoning ordinances as initially adopted.
Affirmed.
VANDE WALLE, MESCHKE, LEVINE and JOHNSON, JJ., concur.
NOTES
[1]  We note that inclusion of "and citizens" "permits any person to be heard, and not merely property owners whose property interests may be adversely affected by the proposed ordinance." United States Dep't of Commerce, A Standard State Zoning Enabling Act § 4, fn. 7 (1926 rev.), reprinted in C. Berger, Land Ownership and Use 657 (2d ed. 1975).

Section 58-03-13, N.D.C.C., is drawn from the Standard State Zoning Enabling Act. The Standard State Zoning Enabling Act was "adopted at one point in all 50 states, and [is] still in effect (with various modifications) in 47 states." 1 Williams Am Land Plan, § 18.01 (1988 Rev.).
[2]  Election statutes, however, are treated differently than other statutes. Generally, election laws are construed as mandatory if enforcement is sought before an election, but as directory after an election. Great Northern Ry. Co. v. Esterby, 179 N.W.2d 725 (N.D.1970). "Because of the importance of elections to the preservation of a democracy" (id., Syllabus ¶ 3), this court has held that "substantial compliance", as distinguished from "strict and literal compliance", with a mandatory statute is sufficient, "if the substantial compliance has effectuated, rather than hindered, the attainment of the purposes of the ballot statute." Morgan v. Hatch, 274 N.W.2d 563, 568 (N.D.1979). See also Mittelstadt v. Bender, 210 N.W.2d 89 (N.D.1973).
