in 1798, france invaded switzerland. the ruler of france was napoleon. he changed many laws. in 1815 switzerland again became independent from france. other countries agreed at the congress of vienna that switzerland was free and neutral.