System.IO.Stream stream = new System.IO.MemoryStream();
Stream is a base class, you need to create one of the specific types of streams, such as MemoryStream.
You have to create an instance of one of the subclasses.
Stream is an abstract class that can't be instantiated directly.
There are a bunch of choices if you look at the bottom of the reference here:
The most common probably being
MemoryStream. Basically, you need to decide where you wish the data backing your stream to come from, then create an instance of the appropriate subclass.