title: Read uploaded pptx file with Open XML SDK
body: <p>I'm trying to build a website where one can upload a .pptx file, and a few aspects would be checked (e.g. slide count). I have the Open XML SDK 2.5 and I have added a reference to it. Yet, when I try to use commands from the SDK, they are not available.</p>
  
  <p>(Also, do I really need a memory stream to process the file? I don't want to store the files, just extract some details from them.)</p>
  
  <p>My code is in VB, but I can read C# too:</p>
  
  <pre><code>Partial Class uploadpresentation
   Inherits System.Web.UI.Page
  
   Protected Sub Upload_Click(sender As Object, e As EventArgs) Handles Upload.Click
      If PptxUpload.HasFile AndAlso PptxUpload.FileName.EndsWith(".pptx") Then
          ProcessFile(PptxUpload.PostedFile)
      End If
   End Sub
  
   Sub ProcessFile(ByVal pptxFile As HttpPostedFile)
  
      using (MemoryStream memoryStream = new MemoryStream())
  
      Using doc As PresentationDocument = PresentationDocument.Open(fileName, False)
  
      outputMessage = "Number of slides: " &amp; argh
  
   End Sub
  End Class
  </code></pre>
  
  <p>My Web.config has this:</p>
  
  <pre><code>  &lt;assemblies&gt;
      &lt;add assembly="DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
      &lt;add assembly="WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
    &lt;/assemblies&gt;
  </code></pre>
  
  <p>So, neither MemoryStream, nor PresentationDocument is recognised. What am I missing here?</p>
  
  <p>Thank you very much!</p>