If you are running this example from your console application, ensure that the console application imports the System namespace by adding using System to the top of your Program.cs file. Also ensure that using System.Runtime.Serialization.Formatters.Binary is added.