Haydn returned to Vienna in 1795. Prince Anton had died, and his successor Nikolaus II proposed that the Esterhazy musical establishment be revived with Haydn serving again as Kapellmeister. Haydn took up the position on a part-time basis. He spent his summers with the Esterhazys in Eisenstadt, and over the course of several years wrote six masses for them.  By this time Haydn had become a public figure in Vienna. He spent most of his time in his home, a large house in the suburb of Windmuhle, and wrote works for public performance. In collaboration with his librettist and mentor Gottfried van Swieten, and with funding from van Swieten's Gesellschaft der Associierten, he composed his two great oratorios, The Creation (1798) and The Seasons (1801). Both were enthusiastically received. Haydn frequently appeared before the public, often leading performances of The Creation and The Seasons for charity benefits, including Tonkunstler-Societat programs with massed musical forces. He also composed instrumental music: the popular Trumpet Concerto, and the last nine in his long series of string quartets, including the Fifths, Emperor, and Sunrise. A brief work, "Gott erhalte Franz den Kaiser" (the "Emperor's Hymn"; 1797), achieved great success and became "the enduring emblem of Austrian identity right up to the First World War" (Jones); in modern times it became (with different words) the national anthem of Germany.  During the later years of this successful period, Haydn faced incipient old age and fluctuating health, and he had to struggle to complete his final works. His last major work, from 1802, was the sixth mass for the Esterhazys, the Harmoniemesse.

Answer this question "Did he compose anything during this time?" by extracting the answer from the text above.
he composed his two great oratorios, The Creation (1798) and The Seasons (1801).