Perfectly discriminating contests (or all pay auction) are widely used as a model of situations where individuals devote resources to win some prize. In reality such contests are often preceded by investments of the contestants into their ability to fight in the contest. This paper studies a two stage game where in the first stage, players can invest to lower their bid cost in a perfectly discriminating contest, which is played in the second stage. Different assumptions on the timing of investment are studied. With simultaneous investments, equilibria in which players play a pure strategy in the investment stage are asymmetric, exhibit incomplete rent dissipation, and expected effort is reduced relative to the game without investment. There also are symmetric mixed strategy equilibria with complete rent dissipation. With sequential investment, the first mover always invests enough to deter the second mover from investing, and enjoys a first mover advantage. I also look at unobservable investments and endogenous timing of investments.