The correct answer is: D. In the short run by the fixed means of production.
Quasi rent is a temporary payment to a factor of production in excess of its opportunity cost. It is earned in the short run, when some factors of production are fixed. In the long run, all factors of production are variable, so there is no quasi rent.
Option A is incorrect because quasi rent is not earned in the long run. Option B is incorrect because quasi rent is not earned by all factors of production. Option C is incorrect because quasi rent is not earned by the variable factors of production.