Cardwell, J.,
delivered the opinion of the court.
By deed dated the 4th day of September, 1903, the Porter-field Lumber Company, a corporation, conveyed its entire holdings, real and personal, to P. E. St. Clair, trustee. The consideration for the conveyance, as set out therein, was “Twenty-five hundred dollars, in hand paid by the party of the second part to the party of the first part . . . and the party of the second part and his associates have assumed and do hereby assume the payment of a certain debt due from the party of the first part to the Bank of Giles, which in no event is to exceed five thousand nine hundred dollars ($5,900), and the said party of the second part and his associates have assumed the payment and do hereby assume the payment of a certain debt due from the party of the first part to Lear & McTilly, as set forth and described in a deed of trust of record in the said clerk’s office . . . in no event to exceed twenty-two thous- and five hundred dollars ($22,500) as of this date, and the said debt is assumed by the said party of the second part and his associates upon the same terms and conditions set forth in *615said deed of trust, and the further consideration of the party of the second part and his associates assuming the payment of other debts contracted by the party of the first part and due from the party of the first part, as set forth in a paper of even date herewith, which said paper described each of the said debts so assumed by the party of the second part and his associates.” In a contract bearing even date with the conveyance just mentioned, made and entered into between the Porterfield Lumber Company, of the first part, and P. F. St. Clair, M. P. Farrier, D. M. St. Clair, T. G. Porterfield and George W. St. Clair, of the second part, the debts to be assumed by P. F. St. Clair, trustee, and his associates, as mentioned in the deed of conveyance, other than the debts due the Bank of Giles and Lear and McTilly, are stated as follows: “A debt due J. Gibson hfcllvane, of Philadelphia, Penn., in no event to exceed two thousand dollars ($2,000.00), which is to be paid either in lumber at market prices or cash, and debts due from Porterfield Lumber Company to various laborers for labor performed, not to exceed in any event two thousand dollars ($2,000.00).” By deed bearing date the 19th day of September, 1903, P. F. St. Clair, trustee, conveyed to the Big Stony Lumber Company, Inc., all of the property, real and personal, which was conveyed to the said St. Clair, trustee, by the Porterfield Lumber Company by its deed of September 4, 1903. The consideration for this conveyance from St. Clair, trustee, to the Big Stony Lumber Company, Inc., is stated as follows: “In consideration of the premises and twenty-five hundred dollars in hand paid, receipt whereof is hereby acknowledged, and the party of the second part assuming the payment of the debts hereinafter set forth and described.” The debts mentioned and described in the deed, as assumed by the party of the second part, are stated as follows: “The payment of a certain debt due from the *616Porterfield. Lumber Company to tbe Bank of Giles, which, in no event, is to exceed $5,900.00, and another debt, which is dne from the Porterfield Lumber Company to Lear & McYitty, Inc., and set forth and described in a deed of trust of record in said clerk's office . . . which said debt, in no event, is to exceed $22,500.00 as of the 4th day of September, 1903, which said debt is assumed by the Big Stony Lumber Company upon the same terms and conditions as set forth in said deed of trust, and the other debts which are hereby ■ assumed by the. Big Stony Lumber Company, Inc., are set forth in a paper dated the 4th day of September, 1903, which said paper is referred to in the deed dated even date therewith, executed by the Porterfield Lumber Company, conveying the properties herein described to P. P. St. Clair.”
To the May term, 1905,..of the Circuit Court of Giles county, J. Gibson Mcllvane and Hugh Mcllvane, partners under the firm style of I. Gibson'Mcllvane and Company, Inc., brought their action by a motion under the statute against the Big Stony Lumber Company, a corporation, P. P. St. Clair, trustee, P. P. St. Clair, M. P. Parrier, D. M. St. Clair and the Porter-field Lumber Company, to recover the sum of two thousand dollars, with interest thereon from the 4th day of September, 1903, basing their right to this recovery upon the contracts, covenants, undertakings and agreements contained in the deed dated the 4th day of September, 1903, above mentioned as executed by the' Porterfield Lumber Company to P. P. St. Clair, trustee; the.-' covenants, contracts, agreements and undertakings contained in the agreement referred to in said deed, dated on the same date therewith, and signed by the Porterfield Lumber Company, P. P. St. Clair, M. P. Parrier, D. M. St. Clair and George W. St. Clair; and the averments, etc., contained in the *617deed of September 19, 1903, from St. Clair, trustee, to the Big Stony Lumber Company.
At the calling of the case the defendants craved oyer of the deed sued on and mentioned in the notice, and produced in ■court the deeds called for in plaintiffs’ notice, of all which oyer was had and said papers read and considered by the court; whereupon the defendants demurred to the notice and moved to dismiss the same, in which demurrer plaintiffs joined and objected to the dismissal of the notice. After argument of counsel the court sustained the demurrer and dismissed the notice, but without prejudice to the rights of plaintiffs to institute such proceeding in equity as they might be advised. To this judgment sustaining the demurrer and dismissing the notice of the plaintiffs, a writ of error was awarded by one of the judges of this •court.
Plaintiffs in error contend that they may maintain.this action in a court of law on either of sections 2415, 2840 or 2860 of the Code of 1904.
Considering, first, section 2840: This statute is what is commonly known as the statute of frauds, and merely provides that certain actions cannot be maintained unless the contract or ■undertaking be in writing and signed by the parties to be ■charged thereby. The provisions of this statute may be plead by way of defense, but clearly it cannot be invoked as a statute to ■sustain a right of action, its purpose being to prohibit actions in certain cases designated; therefore the benefit of it cannot be claimed by one who is not a party to the contract and not ■sought to be charged thereby. Jefferson v. Asch (Minn.), 55 N. W. 604, 25 L. R. A. 264, 39 Am. St. Rep. 618.
Section 2860 changed the common law rule and authorizes the assignee of a bond, or any other chose in action, to sue in his own name, which he could not theretofore do. By this statute *618the assignee or beneficial owner can maintain in his own name “any action which the original obligee, payee or contracting party might have brought.” But plaintiffs in error are clearly neither assignees nor beneficial owners; they are the original and true owners as to the claim asserted against the Porterfield Lumber Company, but not as to the other defendants to this action. There was no consideration moving from plaintiffs in error to the defendants in error other than the Porterfield Lumber Company, and no privity between them. They sue their original debtor, the Porterfield Lumber Company, and the covenantors, P. F. St. Clair, trustee, and his associates and the Big Stony Lumber Company, jointly, and they allege no promise made by the covenantors in the name of some other person, nor that the debt is really due from them. Had they occupied the position of assignees of the Porterfield Lumber Company of a debt due from the covenantors in the deeds and contract upon which they base their action, clearly section 2860 would have entitled them to maintain their action in a court of law; but in such an action they would have no right to a judgment against the Porterfield Lumber Company, as they could not be the owners of the debt sued for and also of a debt due from the Porterfield Lumber Company under the averments of their notice. Under section 2860 the assignee is clothed with just such capacity to sue as existed at common law in his assignor. He is invested with power to institute such actions and such actions only as the assignor could have maintained. Aylett v. Walker, 92 Va. 543, 24 S. E. 226. By accepting the deed from the Porterfield Lumber Company, P. E. St. Clair, trustee, and his associates assumed the debt due to plaintiffs in error, and this debt was also assumed by the Big Stony Lumber Company by the acceptance of the deed from P. E., St. Clair, trustee, and his' associates. The object of the first-named deed was the relief and indemnity *619of the grantor, the Porterfield Lumber Company, and not an additional security for the creditor, and the object of the second deed was the relief and indemnity of both the grantors in that deed and the grantor in the first deed. The latter deed, like°the first, was not an additional security for any creditor named therein. Willard v. Worsham, 76 Va. 396. It would seem clear that the plaintiffs in error are not beneficial owners of the $2,000 for which they sue, as it is a part of the assets of the Porterfield Lumber Company and subject to its liabilities, if any. The deed from the Porterfield Lumber Company to St. Clair and associates would have the effect of estopping the Porterfield Lumber Company from denying it owed plaintiffs in error; but certainly not the effect of transferring the demand against either St. Clair and his associates or the Big Stony Lumber Company. Willard v. Worsham, supra.
If it be regarded that St. Clair and his associates and the Big Stony Lumber Company, of whom we speak as covenantors, agreed by their covenants to be primarily liable for the debt due from the Porterfield Lumber Company to plaintiffs in error, so that as between them and the Porterfield Lumber Company they are the principals and the Porterfield Lumber Company is surety, still this action could not be maintained, because plaintiffs in error must go into a court of equity under the principle that they would, by equitable subrogation, be entitled to enforce the covenant of these covenantors with the Porterfield Lumber Company. The right to do this rests expressly on the ground that the covenant sued on is a collateral security obtained by the Porterfield Lumber Company, which, by equitable subrogation, enured to the benefit of plaintiffs in error, and not on the theory of a contract between the plaintiffs in error and the covenantors. Tatum v. Ballard, 94 Va. 374, 26 S. E. 871; Ellett v. McGhee, 94 Va. 377, 26 S. E. *620874; Willard v. Worsham, supra; Moore v. Triplett, 96 Va. 608, 32 S. E. 50, 70 Am. St. Rep. 882. See, also, notes to Jefferson v. Asch, supra, at p. 263 of 25 L. R. A.
Section 2415 of the Code is as follows: “An immediate estate, or interest in, or the benefit of a condition respecting any estate, may be taken by a person under an instrument, although he be not a party thereto; and if a covenant or promise be made for the sole benefit of a person with whom it is not made, or with whom it is made jointly with others, such person may maintain in his own name any action thereon which he might maintain in case it had been made with him only, and the consideration had moved from him to the party making such covenant or promise.”
Bo case has been .passed upon by this court similar to the one under consideration since the .enactment of section 2415. The nearest approach to it is Jones v. Thomas, 21 Gratt. 96; but this throws blit little light on the true construction of the section as applied to the case at bar. The plaintiff in that case was the promisee, not a third person, the latter being the case here.
In Stuart v. James River & Kanawha Co., 24 Gratt. 295, Anderson, J., discussing who comes within the purview of this section, says: “In the case coming within its purview it only gives the right of action to the person to whom the promise or covenant is not made, when it is made for the sole benefit of such person.”
The test, therefore, in such a case seems to be whether or not the promise or covenant sued on was made for the sole benefit of the plaintiff.
In Newberry Land Co. v. Newberry, 95 Va. 120, 27 S. E. 899, Riely, J., said: “The statute does not enable one who is not a party to the deed to maintain an action thereon unless he *621is plainly designated by tbe instrument as tbe beneficiary, and tbe covenant or promise is made for his sole benefit.” In that case tbe opinion quotes from Johnson v. McClung, 26 W. Va. 659, where the statute of West Virginia, identical with section 2415, was being construed, and tbe facts of tbe case were very similar to tbe facts of tbe case at bar. Tbe opinion in that case by Johnson, P., says: “Tbe statute provides for two classes; first, where tbe covenant or promise is made by one or more for tbe sole benefit of a stranger; that is, one who did not sign tbe covenant; second, where a covenant or promise between several persons is made for tbe sole benefit of one of them who signed it, then in either case be, for whose sole benefit tbe covenant or promise was made, whether be was a party to tbe covenant or not, may maintain an action thereon in his own name. By this construction tbe statute supplying what is necessarily understood would read as follows: Tf a covenant or promise be made for tbe sole benefit of a person with whom it is not made, or (if a covenant or promise be made for tbe sole benefit of a person) with whom it is made jointly with others, such person may maintain in bis own name any action thereon/ etc.” Tbe opinion also discusses what covenants are for tbe sole benefit of third persons, and concludes that the primary object of the parties must be for tbe benefit of tbe third person, and not merely incidental to an agreement between tbe parties to tbe deed, for if incidental it cannot be regarded as for tbe sole benefit of a third person. Says tbe opinion: “In such case it will be regarded for tbe sole benefit of such person when tbe primary object of tbe parties to tbe deed in that covenant relating to such third person was to secure to him tbe payment of money, or to make other provisions for bis benefit.”
*622A case very similar to the one we have under consideration is Keller v. Ashford, 133 U. S. 610, 10 Sup. Ct. 494, 33 L. Ed. 667, where the opinion by Mr. Justice Gray says: “Where a debt already exists from one person to another a promise by a third person to pay such debt being primarily for the benefit of the original debtor, and to relieve him from liability to pay it (there being no novation), he has a right of action against the promisor for his own indemnity; and if the original creditor can also sue, the promisor would be liable to two separate actions, and therefore the rule is that the original creditor cannot sue. His case is not an exception from the general rule that privity of contract is required.”
So our court, in Osborn v. Campbell, 77 Va. 462, held that in a ease where a debtor conveys land to his vendee, the latter assuming as part of the consideration for the conveyance the payment of a debt of the grantor, debtor to a third party, the creditor acquires no right of action against the purchaser, but only the right to be subrogated to the rights of the debtor, subject to all equities between the purchaser and his immediate grantor.
The further contention of plaintiffs in error that sec. 3258a of Va.-Code, 1904, removes all trouble in their way to maintain this action is also untenable. That section merely provides that in a suit brought in a proper forum, whether in equity or at law, where it appears that there has been a misjoinder of parties, plaintiff or defendant, the court may order the action or suit to abate as to any party improperly joined, and proceed by or against the others as if such misjoinder had not been made, etc.; but it does not confer jurisdiction of an action which did not otherwise exist. Here plaintiffs in error are suing in a court of law to avail themselves of the benefit of three instruments in writing containing covenants of indemnity *623and relief of the grantor in the first instrument, which were only available between the parties to the instruments and their privies, and a third party cannot maintain an action thereon against either party thereto at law. The remedy of such third party, if any, is, as the court below practically held, in a court of equity.
The demurrer of defendants in error to the notice filed in this case by plaintiffs in error was properly sustained, and the judgment of the Circuit Court must be affirmed.
Affirmed.