title: How to catch exceptions from Action containing anonymous method in c#?
body: <p>Could any one explain, why am I not getting exception from blow code: </p>
  
  <pre><code>Action &lt;Exception&gt; myact = ( ) =&gt; {       
      throw new Exception( "test" );
    };
  
    Task myactTask = Task.Factory.StartNew( ( ) =&gt; myact);
    try {
      myactTask.Wait( );
      Console.WriteLine( myactTask.Id.ToString( ) );
      Console.WriteLine( myactTask.IsCompleted.ToString( ) );
    }
    catch( AggregateException ex ) {
      throw ex;
    }
  </code></pre>
  
  <p>on the other hand if replace Action "myact" with method "myact()" then I can get exception and it can be handeled with try catch block.</p>
  
  <pre><code>public static void myact( ) {
    throw new Exception( "test" );
  }
  </code></pre>