The following code throws an error with a misleading error message:
string text = “”;
if(text != null )
{
Clipboard.SetText( text, TextDataFormat.Text );
}
System.ArgumentNullException: The value must not be NULL.
Parametername: text
at System.Windows.Forms.Clipboard.SetText(String text, TextDataFormat format)
When you call the method Clipboard.SetText( String text, TextDataFormat format) you also have to check, that the given text is not empty. Otherwise you also get this message, even if it just says, that the value must not be Null.