If spraying the carb works, then you have a fuel delivery problem. Could be the carb itself is gummed up, or could be that fuel delivery pressure is low or full of air bubbles from a leak in the feed line from the tank. A pinhole or tiny crack is enough to suck air or reduce pressure.
One test is to put a short length of new tubing on the fuel pump intake and put other end in a can of gas. If that works, you know the problem is in the fuel line. If it doesn't work, the problem is in the pump or carb.
If you haven't been running the generator regularly, chances are good the carb is bllocked with varnish from evaporated fuel. It will need a thorough cleaning of the jets or a re-build.