Question

In examples on the web, I see that there is a method Dataflow.TransformBlock.Post(), yet I can't get it to compile:

Dim q As New Dataflow.TransformBlock(Of Integer, Integer)(Function(x As Integer) As Integer
                                                                  Return x
                                                              End Function)
q.post(5)

The error is:

'post' is not a member of 'System.Threading.Tasks.Dataflow.TransformBlock(Of Integer, Integer)'.

Was it helpful?

Solution

Post() is an extension method, which means you need to import the TPL Dataflow namespace:

Imports System.Threading.Tasks.Dataflow

If you do that, you could also remove the Dataflow. prefix from the block class name.

OTHER TIPS

According to MSDN this is only available in .NET 4.5 - perhaps you are using an older .NET version and/or not doing Imports System.Threading.Tasks.Dataflow and/or don't reference System.Threading.Tasks.Dataflow.dll in your project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top