title: 'ByRef' parameter '<parametername>' cannot be used in a lambda expression
body: <p>I'm using SharpZipLib to compress files. The library is wrapped in a plugin interface, in a separate DLL. I pass the plugin dll a <code>ByRef</code> parameter to keep track of the compression progress.</p>
  
  <p>SharpZipLib, while compressing, will periodically call a delegate sub passed when launching the compression. I can't figure out how to update the <code>ByRef</code> parameter when the delegate is called. If I try to assign the <code>ByRef</code> variable in the body of a lamba expression, I get a <code>'ByRef' parameter '&lt;parametername&gt;' cannot be used in a lambda expression</code> error.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>Using InputFile As New IO.FileStream(SourceFile, IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.Read)
      Using OutputFile As New IO.FileStream(DestFile, IO.FileMode.Create)
          Using GZipStream As New GZipOutputStream(OutputFile)
              Dim Buffer(524228) As Byte
              Dim Handler As New ProgressHandler(Sub(Sender As Object, EventArgs As ProgressEventArgs) Progress += EventArgs.Processed)
              StreamUtils.Copy(InputFile, GZipStream, Buffer, Handler, New TimeSpan(10000000), Nothing, "")
          End Using
      End Using
  End Using 
  </code></pre>
  
  <p>Thanks!</p>