
    Robert McGannon, Appellant, v Board of Trustees for the Village of Pomona, Respondent.
    [657 NYS2d 745]
   In an action, inter alia, for a judgment declaring that "the zoning ordinances of the defendant are unconstitutional”, the plaintiff appeals from a judgment of the Supreme Court, Rockland County (Miller, J.), dated May 28, 1996, which, upon granting the defendant’s motion for summary judgment dismissing the complaint and denying the plaintiff’s cross motion for summary judgment, dismissed the complaint.

Ordered that the judgment is affirmed, with costs, and the matter is remitted to the Supreme Court, Rockland County, for the entry of a judgment containing an appropriate declaration in favor of the defendant.

A local building inspector erroneously issued the plaintiff a building permit to construct an accessory building on his residential lot which exceeded the size permitted by the Village of Pomona Zoning Code and which was for a purpose not permitted by the code. After the plaintiff commenced construction, a stop-work order was issued.

Contrary to the plaintiff’s contention, the Village is not estopped from enforcing its zoning code. Generally, estoppel may not be invoked against a municipality to prevent it from discharging its statutory duties or for the purpose of preventing the municipality from rectifying an administrative error. The issuance of a building permit does not confer rights in contravention of zoning laws (see, Matter of Parkview Assocs. v City of New York, 71 NY2d 274, 282). Further, had the plaintiff exercised reasonable diligence and reviewed the code, it would have been clear that his contemplated commercial use was illegal and that the size of the structure required a special permit which he had not sought (see, Matter of Parkview Assocs. v City of New York, supra, at 282). Accordingly, the court properly granted the defendant’s motion for summary judgment.

The plaintiff’s remaining contentions are without merit.

We note that since this is, in part, a declaratory judgment action, a judgment should have been entered granting declaratory relief in favor of the defendant (see, Marks v Radmin, 205 AD2d 595). Miller, J. P., Altman, Goldstein and Florio, JJ., concur.  