Step 1: Write the determinant using cofactor expansion along the first row.
For \(M=\begin{bmatrix}2 & 1 & 1\\ 1 & 3 & 0\\ -1 & a & b\end{bmatrix}\), expanding along the first row gives
\[
\det(M)=2\begin{vmatrix}3 & 0\\ a & b\end{vmatrix}-1\begin{vmatrix}1 & 0\\ -1 & b\end{vmatrix}+1\begin{vmatrix}1 & 3\\ -1 & a\end{vmatrix}
\]
Step 2: Evaluate each \(2\times2\) minor.
\[
\begin{vmatrix}3 & 0\\ a & b\end{vmatrix}=3b,\qquad
\begin{vmatrix}1 & 0\\ -1 & b\end{vmatrix}=b,\qquad
\begin{vmatrix}1 & 3\\ -1 & a\end{vmatrix}=a+3
\]
Step 3: Combine the terms.
\[
\det(M)=2(3b)-1(b)+1(a+3)=6b-b+a+3
\]
\[
\det(M)=5b+a+3
\]
Step 4: Apply the condition \(\det(M)\neq0\).
We need \(5b+a+3\neq0\) for the given pair. Check each option by plugging it in.
Step 5: Check option (A), \(a=-\dfrac12,\ b=-\dfrac12\).
\[
5\left(-\tfrac12\right)+\left(-\tfrac12\right)+3=-2.5-0.5+3=0
\]
The result is \(0\), so \(\det(M)=0\) here, which contradicts the given condition. Option (A) is incorrect.
Step 6: Check option (B), \(a=\dfrac12,\ b=\dfrac12\).
\[
5\left(\tfrac12\right)+\tfrac12+3=2.5+0.5+3=6\neq0
\]
This keeps \(\det(M)\neq0\), so option (B) is correct.
Step 7: Check option (C), \(a=-3,\ b=0\).
\[
5(0)+(-3)+3=0
\]
This gives \(\det(M)=0\), contradicting the condition. Option (C) is incorrect.
Step 8: Check option (D), \(a=\dfrac12,\ b=-3\).
\[
5(-3)+\tfrac12+3=-15+3.5=-11.5\neq0
\]
This keeps \(\det(M)\neq0\), so option (D) is correct.
Final Answer:
Only the pairs in options (B) and (D) keep the determinant nonzero.
\[
\boxed{a=\tfrac12,\,b=\tfrac12\ \text{and}\ a=\tfrac12,\,b=-3}
\]