What size capacitor needed to power solenoid?

Approximately : t = RC

C=t/R = 0.05/0.2 = 0.25 Farad.
That is pretty big value for capacitor, 250 000 uF.
Electrolytic type will works, just limit charging current with resistor.
Probably, current will be less than you expect as V/R, as load inductive,
so less capacitors needed.