Do you think it could be the fuel filter as well?Presuming this is a diesel does the fuel shut off solenoid have two or three wires? If two wires one should have power with key in the run position. If three one wire is ground, one is pull in that is energized for starting and 3rd is holding which stays energized while engine is running. I would start by checking to see if you are getting power to coil with key in the run position.
Continuing with the above thought, even if the run lead is getting power it's possible that winding is defective and not holding the valve open. Make sure you're getting full voltage and go from there.