Francesco's uncle had him educated by the Jesuits, first at the "Collegio dei Nobili" in Brera and then at the "Scuole Palatine", both in Milan.
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.
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.