With Visual Studio 2017 †, I have demonstrated that Code Analysis warning CA2204: Literals should be spelled correctly can be avoided by using the following additions to C# version 6:
if (atr == null)
{
throw new InvalidOperationException(
$"No {nameof(ContentProperty)} attribute found on type.");
}
You may also find my answer to String Interpolation in Visual Studio 2015 and IFormatProvider (CA1305) for avoiding CA1305: Specify IFormatProvider to be helpful.
† Note that C# version 6 was delivered with Visual Studio 2013. A newer version of Visual Studio (with a newer version of Code Analysis) might also be necessary to avoid this warning.