$ 0 0 I actually found the error here. I needed to set the memoryStream position to 0. ms.Postion = 0; This fixed the problem.