He became a general manager of public works in Lombardy, so he was unable to participate in the Five Days of Milan in 1848 due to an illness contracted during a mission to the Duchy of Modena. From his long illness he never fully recovered and in 1856 he obtained an early retirement, also to continue his engineering studies to which he could never fully dedicate himself as he would have liked.