In 1773, as a consequence of Emperor Joseph II's Enlightenment-influenced reforms, religious schools lost the right to confer degrees, so Francesco never graduated.
Despite his family's situation, Melzi d'Eril had the opportunity to frequent exclusive Milanese circles, where he met prominent Lombard Enlightenment thinkers such as Pietro Verri, Cesare Beccaria, Giuseppe Parini, and Ippolito Pindemonte.
When Napoleon began his Italian campaign, and entered Milan, Melzi d'Eril first supported the new rule, participating in the government of the Cisalpine Republic.
Later on, when he realized that Napoleon had no interest in the unity of Italy, Melzi d'Eril retired and eventually moved abroad.
Nevertheless, when the Kingdom of Italy was proclaimed in 1805, Napoleon chose Eugène de Beauharnais as his governor, and Melzi d'Eril was somehow set aside from the new government.
Melzi d'Eril was cautious in his relationships with the Austrian Empire, avoiding direct confrontation but also refusing to bow to the new rulers.