5-dihydroisoxazoles were easily prepared from the corresponding 5-chloro-2-methylisoxazolium triflate and an enolizable compound or alkylamine. Their photochemical reactivity leads to photoisomers that in some cases constitute new heterocycles systems. The photorearrangement involves either triplet or singlet state depending on substituents and experimental conditions.