A theorem of Hecke (discussed in this question) shows that if $L$ is a number field, then the image of the different $\mathcal D_L$ in the ideal class group of $L$ is a square.

Hecke's proof, and all other proofs that I know, establish this essentially by evaluating all quadratic ideal class characters on $\mathcal D_L$ and showing that the result is trivial; thus they show that the image of $\mathcal D_L$ is trivial in the ideal class group mod squares, but don't actually exhibit a square root of $\mathcal D_L$ in the ideal class group.

Is there any known construction (in general, or in some interesting cases) of an ideal whose square can be shown to be equivalent (in the ideal class group) to $\mathcal D_L$.

Note: One can ask an analogous question when one replaces the rings of integers by
Hecke algebras acting on spaces of modular forms, and then in some situations I know
that the answer is *yes*. (See this paper.) This gives me some hope that there might be a construction in
this arithmetic context too. (The parallel between Hecke's context (i.e. the number
field setting) and the Hecke algebra setting is something I learnt from Dick Gross.)

Added: Unknown's very interesting comment below seems to show that the answer is "no",
if one interprets "canonical" in a reasonable way. ~~ In light of this, I am going to ask another question which is a tightening of this one. ~~

On second thought: Perhaps I will ask a follow-up question at some point, but I think I need more time to reflect on it. In the meantime, I wonder if there is more that one can say about this question, if not in general, then in some interesting cases.