until 1775. The function of certain rooms at Ludwigsburg changed frequently; converted the Ordenskapelle to a Lutheran church from 1746 to 1748 for Duchess Elisabeth Fredericka Sophie. Beginning in 1757 and lasting into the next year, the suites of the beletage were extensively modified by Philippe de La Guêpière. La Guêpière completed the Schlosstheater in 1758–59, adding a stage, machinery, and the auditorium. A wooden opera house, adorned with mirrors, was constructed in 1764–65, located east of the Alter Hauptbau. Although Charles Eugene officially declared Ludwigsburg Palace his residence in 1764, he made no further modifications after 1770. The palace that had hosted a court that Giacomo Casanova called "the most magnificent in Europe" began a steady decline. Charles Eugene died without a legitimate heir in 1793 and was succeeded by his brother, Frederick II Eugene, who was succeeded by his son Frederick II in 1797. Ludwigsburg Palace had already been Frederick II's summer residence since 1795, and he continued to use it as such with Duchess Charlotte after marrying her on 18 May 1797. Napoleon's armies occupied Württemberg from 1800 to 1801, forcing the duke and duchess to flee to Vienna. The royals returned when Frederick II agreed in 1803 to pledge allegiance to Napoleon and part with Württemberg's territory on the Left Bank, an area of . In exchange, according to the Treaty of Lunéville, Frederick II was named an Elector-prince and given of Right Bank territory. Frederick II, now Elector Frederick I, tasked his court architect Nikolaus Friedrich von Thouret with renovating the palace in the Neoclassical style. Thouret started in the Ahengalerie and the Ordensbau, working there from 1803 to 1806. For two days in October 1805, Napoleon visited Ludwigsburg to coerce Frederick I into joining the Confederation of the Rhine and thus becoming his ally, compensating Württemberg with neighboring territories in the Holy Roman Empire and Frederick I with the title of King. Frederick I again tasked Thouret with a remodeling, from 1808 to 1811, of the Ordenskapelle and the king's apartment. The final modernizations ordered by the king took place from 1812 to 1816 in the Schlosstheater and Marble Hall. During this time, the ceiling frescoes of the Guard Room and the main staircases of the Neuer Hauptbau were repainted. By the time Frederick I died in 1816, the majority of the palace had been converted to reflect the latest style. Following her husband's