Pledging to close a major prison to build thousands of affordable seaside homes is the latest bid to offer housing solutions in the run-up to an election.