On March. 15, 1917, the Elson-Williams Construction Company, a Minnesota corporation, made a contract for the construction of a courthouse in Divide county. On March 31, 1917, this construction company, and the defendant trust company as surety, executed a statutory bond pursuant to § 6832, Compiled Laws of 1913, for the performance of such contract and tne payment of all claims and demands for labor and material to be'furnished thereunder. On May' 9, 1917, the plaintiff, a Minnesota corporation, made a contract with this construction company to furnish all labor and material necessary to make models, casts, and erect all the ornamental plaster of every nature and description, as required by the plans and specifications for the buildings to be constructed. This action is brought on the subcontract so made and upon the statutory bond given for the balance due the plaintiff, against both the construction company and the trust company. The complaint sets forth a copy of the subcontract and the bond given, and alleges that, pursuant to such contract, it has furnished the material and labor required. That the material has been actually incorporated in the buildings, with the consent and approval of the board of county commissioners of Divide county, and that the buildings have been accepted as complete by the architects for Divide county. The defendant trust company interposed an answer alleging six separate defenses, to which the plaintiff demurred. In the trial court, the-demurrer was overruled as to five defenses and sustained as to the sixth defense. Erom the order of the district court so overruling the demurrer, this appeal is prosecuted.
The consideration of this court, accordingly, is addressed to the sufficiency of these five separate defenses, as a matter of law, and they ' will be considered seriatim.
1. The first defense alleges that the plaintiff, a foreign corporation, has not complied with the laws of this state relative to foreign corporations (Comp. Laws 1913, § 5238) ; that it is not authorized to transact any business in this state, and that, if any contract has been made in its behalf, the same is under the laws of this state and void, under § 5242, Comp. Laws 1913, and that therefore the plaintiff is barred and es-topped from maintaining this action.
Section 5238, Compiled Laws of 1913 (as amended by chap. 96 of the Laws of 1915), as far as material herein, provides as follows:
*632“No foreign corporation, association, or joint stock company, . . „ shall sell or otherwise dispose of its capital stock or transact any business within this state . . . until such corporation shall have filed in the office of the secretary of state a copy of its articles of incorporation . . . together with a certificate, etc.”
The plaintiff contends that this defense does not allege that the plaintiff has transacted or done business in this state contrary to the statute; also, that in any event the pleadings present no other issue than the performance of a single or isolated transaction within the state which is not subject to the inhibitions of the statute.
The defendant contends that it appears upon the face of the pleadings that the plaintiff was transacting business within the state without compliance with and contrary to the statute.
In the subcontract, made a part of the complaint, the plaintiff agreed to furnish all material and perform all work for the county buildings, at Crosby, North Dakota, in accordance with the general conditions of the principal contract, and the drawings and specifications therefor, — all of which are made a part of the subcontract. In § 2 of such subcontract, it is further provided:
“The subcontractor and the contractor agree that the material to be furnished by the subcontractor, are all the labor and material necessary to make the models’ cast and erect all the ornamental plaster of every nature and description, including all the ornamental plaster, which is to be run or cast on the job as well as that which is to be cast in the factory and erected on the job.”
In § 3 thereof, the plaintiff further agreed to complete the several portions thereof and the whole of the work so sublet by November 15, 1917, and to proceed with the erection and installation of the work comprehended in such manner as to co-operate with the plain plastering contractor and the general contractor.
. These provisions of the contract, made a part of the complaint, undoubtedly show that the plaintiff agreed to furnish some materials and to perform some labor in North Dakota.
Whether these provisions, however, affirmatively allege a “transaction of business” in this state is another question.
It has heretofore been held by this court that the burden is not on a foreign corporation to either prove compliance with the statute, or that *633it was not doing business in this state contrary to the statute; that the presumption is in favor of their right to do business; that he who asserts that there is illegality in the transaction, fair on its face, must plead and prove it. That if the illegality of the contract sued on or the absence of the right to sue does not appear on the face of the complaint, the facts showing the illegality or absence of right to sue must be pleaded as a defehse. State use of Hart-Parr Co. v. Robb-Lawrence Co. 15 N. D. 55, 60, 106 N. W. 406; Hanson v. Lindstrom, 15 N. D. 584, 108 N. W. 798.
The statute involved must be considered in connection with the constitutional provisions and other cognate statutory provisions.
Section 136 of the Constitution provides that no foreign corporation shall do business in the state without having one or more places of business and an authorized agent or agents in the same, upon whom process may be served.
Section 5240, Compiled Laws 1913, requires foreign corporations, subject to the provisions of § 5238, to appoint the secretary of state its attorney upon whom process may be served, and § 5242, Compiled Laws of 1913, provides that contracts made without compliance with § 5238, Compiled Laws 1913, shall be void on the behalf of the offending corporation or its assigns.
Concerning these matters, this court, in State use of Hart-Parr Co. v, Robb-Lawrence Co. supra, stated: “In view of this constitutional provision it is clear that compliance only with the statutory provisions above referred to would be of no avail in this state, unless it also had one or more places of business within the state as required by the Constitution. The legislature could not. waive a condition which the Constitution imposed. The statute and the Constitution must therefore be read together, and the former must be construed as supplementary to the latter. Both the statutory and the constitutional prohibitions relate to the same class of foreign corporations, viz., those ‘doing business’ in this state. The statute imposes additional conditions to those imposed by the Constitution, and specifically declares what shall he the consequences of a violation of the statutory and constitutional prohibition. These prohibitions apply only to those foreign corporations which do business in the state. What is meant by ‘doing business’ or ‘transacting business V . . . The fact that foreign corporations proposing to do *634business bere are required to establish a place of business within the state makes it clear that the term ‘doing business’ does not mean a single ‘isolated transaction.’ It is not reasonable to suppose that the Constitution or the statute intended that a foreign corporation, without intending a continuance of its business in the state, could not collect a debt or make any contract,' or demand that its property rights should be respected, unless it had previously acquired a situs or domicil within our borders. The object of laws of this character is to require foreign corporations which undertake to carry on their business generally in this state, to establish a domicil or situs here so that they shall, like domestic corpoi’ations, be within reach of the process of our courts. The term ‘transacting or doing business’ as used in laws of this character implies continuity, and does not mean a single isolated transaction done within the borders of the state without any purpose of engaging generally in the carrying on of its business here.” See also Sucker State Drill Co. v. Wirtz Bros. 17 N. D. 313, 18 L.R.A.(N.S.) 134, 115 N. W. 844; Sioux Remedy Co. v. Cope, 235 U. S. 197, 59 L. ed. 193, 35 Sup. Ct. Rep. 57.
The defendant, under a general denial of the allegations of plaintiff’s complaint, put in issue the subcontract, and the labor and material furnished thereunder. The defendant does not specifically allege that the plaintiff has done or transacted business in this state. The complaint, in this regard, cannot be construed to affirmatively allege a transaction or doing of business in this state contrary to the statute. Without intimating whether the proof under the broad allegations of the complaint will bring the plaintiff within the inhibition of the statute, we are clearly of the opinion, following the authorities above quoted, that the issue of the noneompliance of the plaintiff with the statute in question is not presented upon the pleadings, and that therefore the demurrer as to the first defense should have been sustained.
2. The second defense is that the trust company notified the plaintiff that it should proceed against the principal, the construction company, and that unless it so did, the trust company would consider itself exonerated under § 6683, Compiled Laws 1913, and that the plaintiff had failed to so proceed against such principal, whereby the trust company was released and exonerated on its bond.
Section 6683, Compiled Laws of 1913, provides: “A surety may *635require bis creditors to proceed against tbe principal or to pursue any other remedy in bis power, wbicb tbe surety cannot biinseif pursue and wbieb would lighten bis burden; and if in such case the creditor neglects to do so, tbe surety is exonerated to tbe extent to wbicb be is thereby prejudiced.”
This defense is deemed without merit. Tbe complaint sets forth a cause of action upon a statutory bond, signed by tbe construction company as principal and tbe trust company as surety. Upon this bond both of tbe defendants are primarily liable. 32 Cyc. 20; Northern State Bank v. Bellamy, 19 N. D. 513, 31 L.R.A.(N.S.) 149, 125 N. W. 888; Yerxa v. Ruthruff, 19 N. D. 16, 25 L.R.A.(N.S.) 139, 120 N. W. 758, Ann. Cas. 1912D, 809. Both of tbe defendants have been sued in this action upon this bond. Tbe plaintiff clearly bad tbe right to so institute action. Compiled Laws 1913, §§ 5767 and 5768; Northern Trust Co. v. First Nat. Bank, 25 N. D. 81, 140 N. W. 705. Tbe defendant contends that it relied upon tbe express provisions of tbe statute, § 6685. To do so, it must clearly set forth allegations wbicb cause such statute to operate. Tbe statute, in effect, is a declaration of tbe rule in equity for tbe exoneration of a surety. 32 Cyc. 234; Scbroeppel v. Shaw, 5 Barb. 580, 592; Story, Eq. Jur. 13th ed. §§ 324, 325.
Its intent is to provide for an exoneration, to tbe extent only that a surety has been prejudiced where a seasonable notice and demand has been made to proceed against tbe principal upon tbe obligations, and tbe failure to so do has prejudiced tbe surety. This notice and demand must be specific and definite. Kennedy v. Falde, 4 Dak. 319, 29 N. W. 667; Bailey Loan Co. v. Seward, 9 S. D. 326, 69 N. W. 58; Fulton v. Matthews, 15 Johns. 435, 8 Am. Dec. 261. Tbe allegations of tbe defendant concerning notice and demand are neither specific nor definite ; they do not even allege a notice and demand prior to tbe institution of this action. Tbe allegations of this defense do not admit a bond to -exist; they specify no particular proceedings that should have been commenced prior to tbe commencement of this action. They set forth no resulting prejudice. Tbe trial cour-t should have sustained tbe demurrer interposed to such alleged defense.
3. Tbe third defense is that tbe board of county commissioners >of Divide county and tbe construction company made alterations and *636changes in the terms and conditions of the original contract, and in tbs-work and labor to be performed and the compensation to be received, without the knowledge and consent of the trust company, whereby it is discharged and exonerated from liability.
The complaint is based upon the original contract as made and the statutory bond given therefor, and upon the labor and material furnished under a subcontract pursuant to the terms of the original contract.
There is no allegation in this defense that the plaintiff knew or consented to any change, amendment, or alteration of the original contract, or that any of the material or labor furnished under the subcontract was so furnished pursuant to the amended or altered original contract.'
Under § 6832, Compiled Laws 1913, the statutory bond given herein stands as security for all claims and demands on account of labor and material furnished in and about the performance of the contract involved, and any person having a lawful claim against the contractor for labor and material so furnished may sue in his own name and recover in his own name the same as though the bond were made payable to him.
The bond is made for the benefit of such person. In effect, such person is an obligee therein. In effect such bond contains an agreement to pay such person for the labor or material furnished in the governmental contract. Griffith v. Rundle, 23 Wash. 453, 55 L.R.A. 381, 63 Pac. 199; Conn v. State, 125 Ind. 514, 25 N. E. 443; Kaufmann v. Cooper, 46 Neb. 649, 65 N. W. 796; Doll v. Crume, 41 Neb. 655, 59 N. W. 806. See notes in 27 L.RA.(N.S.) 573; L.RA.1915A, 768.
It is well settled that changes or alterations made in a contract without the knowledge, participation, or consent of the obligee or creditor, do not discharge or exonerate the surety. 32 Cyc. 178; 21 R C. L. p. 1016.
Furthermore, in bonds of this character containing, in a sense, a pub-. lie obligation, the surety is charged with notice that third persons may and will rely upon the same and that the state, the nominal obligee, is a mere trustee incapable of bartering away for its benefit and convenience the rights of the beneficiaries. 21 R C. L. p. 1016.
Hence, the rule is stated that “changes in a contract for the perform-*637unce of a public work, though not contemplated in such contract and made without the knowledge and consent of the surety on the contract- or’s bond, do not release the surety from his obligation under such bond to pay promptly all persons supplying the contractor with labor and material for the prosecution of the work, at least so far' as their labor and materials are supplied in accordance with the original contract.” 21 R. C. L. p. 1016. Equitable Surety Co. v. McMillan, 234 U. S. 448, 58 L. ed. 1394, 34 Sup. Ct. Rep. 803; See United States Fidelity & G. Co. v. Golden Pressed Brick Co. (United States Fidelity & G. Co. v. United States) 191 U. S. 416, 48 L. ed. 242, 24 Sup. Ct. Rep. 142.
Accordingly it has been held that changes made by a contractor and the board of county commissioners in the course of the erection of a county building, without the consent of the laborers or materialmen employed therein, will not deprive the latter of their right of action on the bond given therefor. Conn v. State, 125 Ind. 514, 25 N. E. 443;. Dewey v. State, 91 Ind. 173; Steffes v. Lemke, 40 Minn. 27, 41 N. W. 302; Standard Asphalt & Rubber Co. v. Texas Bldg. Co. 99 Kan. 567, L.R.A.1917C, 490, 162 Pac. 299.
This holding does not obligate the surety beyond the express terms of its contract, or permit the defendant to avail itself of the provisions of § 6668, Compiled Laws 1913. ^
Under these principles, the defense alleged is insufficient and the demurrer should have been sustained. It is so ordered.
4. The fourth defense is that the construction company and the board of county commissioners of Divide county, without the knowledge or consent of the trust company, and contrary to' the terms of the principal contract, assigned such contract to another construction company on or about August 7, 1917, and that after that time the original construction company, the principal in the bond, was not a party to the contract and did not perform the work for which the plaintiff claims to have furnished the labor and material, and, further, that on said August 7, 1917, there were ample funds in hands of the county, retained under the terms of the contract, with which to pay the plaintiff for its demands.
Under the principles of law which apply peculiarly to statutory bonds made for the benefit of materialmen and laborers as heretofore stated, it is clearly evident that the authorities and principles of law *638cited by tbe trust company to tbe effect that any change or substitution of tbe original contracting parties releases tbe surety do not apply in tbe case at bar.
Under these principles of law heretofore stated, if tbe plaintiff furnished labor and material pursuant to tbe terms of tbe original contract and pursuant to tbe subcontract as made, tbe obligation of tbe surety, tbe trust company on tbe bond given, is not discharged by a change of tbe original parties, or by an assignment of tbe originaL contract, made without tbe knowledge or consent of tbe plaintiff. Otherwise, a default in tbe principal contractor, occurring during tbe course of tbe work, a failure to perform, a substitution of another principal contractor, voluntary or involuntary, in order to secure tbe completion of tbe project, would render every such statutory bond nugatory even though tbe materialman bad bona fide performed bis part of tbe contract, and would obviate tbe very purposes for which such statutory bond was prescribed.
Tbe statute creating a direct obligation between surety and tbe materialman or laborer, at tbe time of the acceptance of tbe bond, tbe surety, to exonerate this obligation, must both allege and prove, tbe act or participation of such obligee which in law will occasion a release or discharge.
This defense alleges neither notice, knowledge, nor acquiescence of tbe plaintiff in tbe alleged assignment. It alleges no change in tbe subcontract, tbe parties thereto, or in tbe work or labor furnished or to be furnished thereunder.
In Kaufmann v. Cooper, 46 Neb. 649, 65 N. W. 796, where a statutory bond was issued for the erection of an industrial home, and where, in an action upon the' bond given by a materialman, tbe surety urged that tbe bond was discharged by tbe assignment of the principal contract frcm one partnership to another, tbe material having been furnished to tbe second partnership, it was held, following tbe principles hereinbefore stated, that tbe bond was not released. See also Freeman v. Berkey, 45 Minn. 438, 48 N. W. 194; Abbott v. Morrissette, 46 Minn. 10, 48 N. W. 416; Griffith v. Rundle, 23 Wash. 453, 55 L.R.A.381, 63 Pac. 199.
Tbe alleged defense of moneys in tbe hands of tbe county sufficient *639to pay tbe demands of the plaintiff does not operate to release the obligation of the surety.
It therefore follows that this alleged defense is insufficient. The demurrer is sustained. ~
5. The fifth defense alleged in substance that the construction company, in form a corporation, was, in fact, a contracting business-wholly managed by one Williams and one Elson. That the bond in question was made upon the reliance that the work and material to be furnished under the contract would be'under the control and supervision of said Williams and Elson, — all of which the board of county commissioners well knew. That on or about August 7, 1917, without the knowledge or consent of the trust company, the county assigned the contract to the Wilbur S. Williams Construction Company, to dispense with the services of said Elson, and that for a period of about sixty days thereafter the major portion of the construction work was performed under the direction of said Williams. That the said Williams and his company converted to his own use moneys and payments made to said Williams Construction Company, and neglected and refused to pay for labor and materials furnished, and finally became in default under the terms and conditions of the contract, and abandoned the same on or about November 15, 1917, — all with the knowledge of the county and without the consent or knowledge of the trust company. That no notice of default was served on the trust company, and, without permitting it so to do, allowed other persons to complete the work upon the construction.
• Following the principles of law heretofore stated, it is obvious that, this defense likewise is without merit. The questions of law that might arise upon an abandoned project are not presented. It is neither alleged nor claimed that the plaintiff did not furnish the labor and material in the construction completed. The question of the right of the plaintiff to recover on its contract and the bond involved, in the-event that it had been prevented from fulfilling the same or a part thereof, by the abandonment of the project, is therefore not involved.
In contract work of this character two bonds are furnished by the. contractor, — one for the county as real obligee, under § 3296, Compiled Laws 1913, and the other, the bond herein required under § 6832,. Compiled Laws 1913.
*640This defense may be sufficient upon the former bond. . It is wholly insufficient upon the latter. There is no averment in this defense of participation, notice, knowledge, or consent of the plaintiff in such allegations. Such allegations, if true, do not in'any manner increase the express terms of the trust company’s obligation in its bond to and for the plaintiff; they do not exonerate the obligation assumed in the bond to the plaintiff. See authorities cited supra; also School Dist. ex rel. Koken Iron Works v. Livers, 141 Mo. 580, 49 S. W. 507; Doll v. Crume, 41 Neb. 655, 59 N. W. 806; Henricus v. Englert, 137 N. Y. 488, 33 N. E. 550.
The demurrer, accordingly, to this defense, should have been sustained.
It is therefore ordered that the demurrer of the plaintiff to the five alleged defenses herein be sustained, with costs to the appellant.