I am coding a C# .NET 3.0 asynchronous call to a WCF service. And I get the following error.
Error 1 Using the generic type ‘System.Action’ requires ‘1’ type
arguments.
But when doing this in .NET 3.5 no error occurs. Doesn’t .NET 3.0 support this or I am doing wrong. I have to use .NET 3.0 because iam writing a application for XPe.
This is how my code looks like.
AsyncCallback aSyncCallBack =
delegate(IAsyncResult result)
{
try
{
service.EndSubscribe(result);
this.Dispatcher.BeginInvoke((Action)delegate
{ DGStudent.ItemsSource = test; });
}
catch (Exception ex)
{
this.Dispatcher.BeginInvoke((Action)delegate
{ MessageBox.Show(ex.Message); });
}
};
The non-generic
System.Actionwas introduced in .NET 3.5 and cannot be used from .NET 3.0. The compiler thinks you mean the genericSystem.Action<T>which does require a type parameter.