Not OP but in many municipalities the dwelling would be no longer up to code, and therefore illegal to inhabit
This is different. Many municipalities specifically require all dwellings to have basic utilities (water, sewer, electricity, garbage service), even if you're not using them. Not having that will get you in trouble pretty quickly.
Unincorporated areas are usually fair game.