문제

I'm trying to run the Microsoft TPL DataFlow complete example at the bottom of 'How to: Write Messages to and Read Messages from a Dataflow Block' but the code will not compile as-is. I have pulled down the TPL DataFlow package (v 4.5.9) in NuGet, and the references appear to be working. But the SendAsync method doesn't appear to be valid. Do I need to do something special because it's an extension method?

All I get is

'sendasync' is not a member of 'System.Threading.Tasks.DataFlow.BufferBlock(Of Integer)'

Code Screenshot:

Code Screenshot

References:

enter image description here

NuGet Packages:

enter image description here

도움이 되었습니까?

해결책

When I tried this, it worked just fine for me.

Maybe it's not the actual error and you have some unrelated error in your solution. Have you confirmed that you don't have any other errors?

다른 팁

For others who have this issue, sendasync is an extension in the namespace system.threading.tasks.dataflow so if you must use the import statements shown above.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top