The office of the New York attorney general, Eric T. Schneiderman, has issued a “notice of violation” to Donald J. Trump’s foundation, ordering it to immediately stop soliciting charitable donations in the state.

The letter, which was sent on Friday and released on Monday morning by Mr. Schneiderman’s office, said its charities bureau had determined that the Donald J. Trump Foundation had been fund-raising in New York this year when it was not registered to do so under state law.

“The Trump Foundation must immediately cease soliciting contributions or engaging in any other fund-raising activities in New York,” wrote James Sheehan, the chief of the charities bureau.

Mr. Trump’s foundation has come under increasing scrutiny amid questions about his fulfillment of large charitable pledges and his lack of financial support in recent years.