2. In $\triangle A B C$, $a$, $b$, $c$ are the lengths of the sides opposite to $\angle A$, $\angle B$, $\angle C$ respectively. If $\cos A + \sin A - \frac{2}{\cos B + \sin B} = 0$, then the value of $\frac{a+b}{c}$ is ( ).
(A) 1
(B) $\sqrt{2}$
(C) $\sqrt{3}$
(D) 2
2.B.

From $\cos A+\sin A-\frac{2}{\cos B+\sin B}=0$, we get
$$
\sqrt{2} \sin \left(A+\frac{\pi}{4}\right)-\frac{2}{\sqrt{2} \sin \left(B+\frac{\pi}{4}\right)}=0,
$$

which means $\sin \left(A+\frac{\pi}{4}\right) \cdot \sin \left(B+\frac{\pi}{4}\right)=1$.
By the boundedness of the sine function and the fact that $\angle A, \angle B$ are interior angles of a triangle, we have
$$
\sin \left(A+\frac{\pi}{4}\right)=1 \text { and } \sin \left(B+\frac{\pi}{4}\right)=1 \text {. }
$$

Thus, $\angle A=\angle B=\frac{\pi}{4}$. Therefore, $\angle C=\frac{\pi}{2}$.
Hence, $\frac{a+b}{c}=\sin A+\sin B=\sqrt{2}$.