We study Serre duality in the singularity category of an isolated Gorenstein
singularity and find an explicit formula for the duality pairing in terms of
generalised fractions and the Grothendieck residue symbol. For hypersurfaces we
recover the residue formula of the string theorists Kapustin and Li. These
formulas are obtained from an explicit construction of complete injective
resolutions of maximal Cohen-Macaulay modules.