This phrase means something goes against what you expect. It shows something is different from a rule or a wish.
、。
Contrary to the experts' predictions, the stock prices plummeted.
、に。
Contrary to his parents' expectations, he did not go on to university.
、。
That player, against the coach's orders, continued with his own style of play.
、。
Contrary to our wishes, it seems it will rain tomorrow.
、で。
Doing a side job against company rules is not permitted in many corporations.