Costs incurred in connection with setting up depositions that were eventually not taken may still be recoverable court costs under CCP 1033.5 if reasonably necessary to the prosecution or defense of the case. Here, on dismissal of the case, defendant was entitled to fees a deposition reporter charged for late cancellation of one deposition and for preparing a notice of nonappearance for another deposition. Both depositions were of plaintiff’s treating physicians who were necessary witnesses regarding plaintiff’s alleged physical injuries for which recovery was sought in the lawsuit.