  In the present paper, we investigate a conjecture of J\"urgen Herzog. Let $S$
be a local regular ring with residue field $K$ or a positively graded
$K$-algebra, $I\subset S$ be a perfect ideal of grade two, and let $R=S/I$ with
canonical module $\omega_R$. Herzog conjectured that the canonical trace
$\text{tr}(\omega_R)$ is obtained by specialization from the generic case of
maximal minors. We prove this conjecture in several cases, and present a
criterion that guarantees that the canonical trace specializes under some
additional assumptions. As the final conclusion of all of our results, we
classify the nearly Gorenstein monomial ideals of height two.
