Hi Anthony,
many MCU tolerate I/O inputs higher than their supply voltage, but they won't tolerate an input of 24VDC. Further the solenoid valves normally require an activation current between 40 and 100mA, which the MCU is not able to supply even on one output pin.
The easiest solution would be connecting the gate-pin of an N-Channel MosFet via a low value resistor (100 to 300Ω) to the output pin of the MCU, connect the 24VDC with their positive terminal to +24V and their negative terminal to the drain pin of the MosFet. The source of the MosFet will be connected to GND.
To make it safer for the MCU in any case you might use opto-isolators as well. Use the input pins to connect to the switch indicator and use a LED in parallel to the solenoid to indicate if the solenoid is really activated.
I don't like the idea of using AC-supplied solenoids. They are wound bifilar and if one side burns up, the resistance halves overstressing the driver not activating the valve, but have it just humming. If the driver happens to be an opto-triac the AC will fire up the MCU. (experienced with an MCU controlled fan controller in countless numbers of fried Z80s.)
Boncuk