They have been for years.
And they work. Problem is, the guns tend to wear out absurdly quickly or occasionally explode.
The more durable models aren't really as portable as traditional firearms. And considering you can build a traditional missile launcher or high caliber gun for a small fraction of what it costs, it hasn't been readily adopted.
Smaller scale coilguns are being seen as somewhat more feasible. But I doubt we'll be seeing standard military application of it anytime soon.