This is unlikely to be related to your problem, but using a StreamReader and StreamWriter to save it as a file is bad form. What if your resource contains a zero? What you could do instead is something like this:
public static void CopyStream(Stream source, Stream destination)
{
byte[] buffer = new byte[128];
long previousSourceIndex = source.Position;
int read = source.Read(buffer, 0, buffer.Length);
while(read != 0)
{
destination.Write(buffer, 0, read);
read = source.Read(buffer, 0, buffer.Length);
}
source.Position = previousSourceIndex;
}
Pass the manifest resource stream as the source, and a FileStream as a destination. Don't forget to close the Streams properly when you've finished - a using block would be helpful