title: Expression does not produce a value in vb.net application
body: <p>I have a Winforms application, in which I'd like to use the MVVM design pattern :</p>
  
  <p>I follow this <a href="http://blog.soat.fr/2012/02/comment-utiliser-mvvm-avec-windows-forms/" rel="nofollow">tutorial</a></p>
  
  <p>It is very interesting  article, but i get this problem : My application is vb.net and I convert the code ( C#) to vb.net, it works fine except this one:</p>
  
  <p><strong>C# code</strong></p>
  
  <pre><code> protected void ViewModel_Validated(object sender, EventArgs e)
      {
          this.ViewModel.AttachedControls.ToList().ForEach(c =&gt; this.errorProvider.SetError(c.Value as Control, ""));
          if (!string.IsNullOrEmpty(this.ViewModel.Error)) {
              this.ViewModel.Messages.ToList().ForEach(message =&gt; {
                  this.errorProvider.SetError(this.ViewModel.AttachedControls[message.Key] as Control, message.Value);
              });
          }
      } 
  </code></pre>
  
  <p><strong>Vb.net code</strong></p>
  
  <pre><code> Protected Sub ViewModel_Validated(ByVal sender As Object, ByVal e As EventArgs)
          Me.ViewModel.AttachedControls.ToList().ForEach(Function(c) Me.errorProvider.SetError(TryCast(c.Value, Control), ""))
          If Not String.IsNullOrEmpty(Me.ViewModel.[Error]) Then
              Me.ViewModel.Messages.ToList().ForEach(Function(message)
                                                         Me.errorProvider.SetError(TryCast(Me.ViewModel.AttachedControls(message.Key), Control), message.Value)
  
                                                     End Function)
          End If
      End Sub
  </code></pre>
  
  <p>The problem is in this line:</p>
  
  <pre><code>Me.ViewModel.AttachedControls.ToList().ForEach(Function(c) Me.errorProvider.SetError(TryCast(c.Value, Control), ""))
  </code></pre>
  
  <p><strong>The Error:</strong></p>
  
  <p><code>Expression does not produce a value.</code></p>
  
  <p>I need to know </p>
  
  <ul>
  <li>What is the reason of this error?</li>
  <li>How can I fix it?</li>
  </ul>