“The truth is the press misunderstands and never records the big accomplishments of the White House,” Mr. Ryan said, for a second agreeing with the president. “Look at all the jobs that the president has created. Just among the White House staff!”

“Every morning I wake up in my office and I scroll through Twitter to see which tweets I will have to pretend I didn’t see later on,” he added. “Every afternoon former Speaker John Boehner calls me up, not to give advice, just to laugh.”

Mr. Ryan’s address was the highlight of the event, officially the Alfred E. Smith Memorial Foundation Dinner, which raised $3.4 million for charity but which at times lacked the panache and elegance of past years. For the first time since 1945, the annual dinner was not held in the classic Art Deco ballroom of the Waldorf Astoria hotel, which is under renovation. Instead, it was a few blocks away at the less glamorous New York Hilton Midtown.

“We are going to try to get back there as quickly as we can,” Mary Callahan Erdoes, the new vice chairwoman of the foundation, told the more than 800 guests in a near-apology.

Also missing were the political jabs of Alfred E. Smith IV, the great-grandson of the dinner’s eponym, who stepped down as master of ceremonies after last year’s dinner after serving in that position for 35 years. This year’s host, the actress Patricia Heaton, was unfailingly nice, which meant she was shocked by how aggressive some of the jibes from the dais were.