2. As shown in Figure 1, $ABCD$ is a square with a side length of 1. On the line containing the diagonal $AC$, there are two points $M$ and $N$ such that $\angle MBN=135^{\circ}$. Then the minimum value of $MN$ is ( ).
(A) $1+\sqrt{2}$
(B) $2+\sqrt{2}$
Figure 1
(C) $3+\sqrt{2}$
(D) $2 \sqrt{2}$
2.B.

Let $A M=x$. It is easy to prove that $\triangle A B M \backsim \triangle C N B$.
Therefore, $\frac{A B}{C N}=\frac{A M}{C B}$, which means $\frac{1}{C N}=\frac{x}{1}$, or $C N=\frac{1}{x}$.
Thus, $M N=A M+A C+C N=x+\sqrt{2}+\frac{1}{x}$ $=\left(\sqrt{x}-\frac{1}{\sqrt{x}}\right)^{2}+2+\sqrt{2} \geqslant 2+\sqrt{2}$.