Take $X:=\mathbb{R}$ and $D:=\mathbb{R}\setminus\{0\}$. Consider any sequence of continuous functions $(f_n)_n$ that converges uniformly to $0$ on compact sets of $D$, but with $\langle \delta_0,f_n\rangle:=f_n(0)=1$, like e.g. $f_n(x):=(1-n|x|)_+$ .
rmk. Of course the same example works for any $D\subset\mathbb{R}$ such that $0\notin D$, thus also, up to a translation, for any proper subset $D$ of $\mathbb{R}$.