Having an issue on a 330I, car had a crankshaft sensor go out and after fixing it, the car cranks up and turns on but dies immediately even pumping the gas to try and keep it on. No codes come up so I assume its a vacuum leak I'm taking out the IAC as we speak to clean it. Engine doesn't sound abnormal at all when its on, just starts and then dies as if it has no gas. Checked the fuel pumps on it as well, all good
Did you check the fuel pump with a mechanical gauge? How about the filter?
Update: The crankshaft sensor and IAC vavle have been replaced. The engine now however doesn't spark at first, we thought the aftermarket crankshaft sensor was bad so we bought one from bmw and still no spark. Just checked the ignition coil fuse and it's not blown. I'm befuddled but still hopeful we can figure it out.
I hope you checked the battery and alternator. Recheck you didnt remove any wiring. Maybe the crank sensor needs to be put in some specific way or needs to be programed ....