  The critical Ising model in two dimensions with a defect line is analyzed to
deliver the first exact solution with twisted boundary conditions. We derive
exact expressions for the eigenvalues of the transfer matrix and obtain
analytically the partition function and the asymptotic expansions of the free
energy and inverse correlation lengths for an infinitely long cylinder of
circumference $L_x$. We find that finite-size corrections to scaling are of the
form $a_k/L^{2k-1}_x$ for the free energy $f$ and $b_k(p)/L_x^{2k-1}$ and
$c_k(p)/L_x^{2k-1}$ for inverse correlation lengths $\xi^{-1}_p$ and
$\xi^{-1}_{L-p}$, respectively, with integer values of $k$. By exact evaluation
we find that the amplitude ratios $b_k(p)/a_k$ and $c_k(p)/a_k$ are universal
and verify this universal behavior using a perturbative conformal approach.
