vs2012/.net 4.5 RC Compiler error, when using ActionBlock, missing reference to System.Threading.Tasks
-
Thursday, June 07, 2012 10:29 AM
Hello guys,
I'm using the TDF rc with .net 4.5, but when i declare an ActionBlock the compiler gives this error:
Error 1 The type 'System.Threading.Tasks.Task' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
However there is no such dll when i go to add a reference, and msdn tells me Task is in mscorelib.
i found this on SO:But surely that is not the way to go, atelast not at rtm, is this a bug in TDF or somewhere else? or am i doing something wrong?
regards/allan
All Replies
-
Thursday, June 07, 2012 10:35 AM
To replicate, make a new console app, add the nuget package, then paste this and compile:
using System.Threading.Tasks.Dataflow; namespace Sandbox { class Program { static void Main(string[] args) { var a = new ActionBlock<int>(i => { }); } } }
-
Thursday, June 07, 2012 1:14 PMAs I said in the SO question, I have also posted this to Connect.
-
Thursday, June 07, 2012 6:27 PMOwner
allan,
What build of the VS are you using? In Pre-RC bits this is to be expected. The workaround is manually adding those assemblies to the console app.Let me know in case this is not your situation.
thanks
-alok
-
Thursday, June 07, 2012 6:51 PMOwner
allan, svick,
Another quick follow up. If in fact you are using RC bits and hit this issues, please go to your project and remove the reference to System.Runtime, it should compile. This should get you unblocked immediately. We have identified the bug causing this and will fix it in the next release.
Hope that helps
cheers
-alok
- Proposed As Answer by Alok Shriram- MSFTOwner Thursday, June 07, 2012 10:16 PM
- Marked As Answer by aL3891 Friday, June 08, 2012 8:50 PM
-
Thursday, June 07, 2012 7:00 PMRemoving the reference does work, thanks.
-
Friday, June 08, 2012 8:51 PM
yes, i'm using the RC (both vs and tdf) and removing said reference does resolve the issue for me as well, thanks guys :)
regards /allan
-
Friday, June 08, 2012 9:07 PMOwner
A quick update on this issue. We have shipped an updated NuGet package for Dataflow which fixes the above issues. New installations of NuGet for this library will not suffer from this issue.
Please let us know of any other issues and let us know of any more feedback
cheers
-alok
-
Saturday, October 13, 2012 1:30 AM
This is still not fixed.
In VS2012, I try to use the library, and get the following error:
"Reference required to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' containing the base class 'System.Object'. Add one to your project."
It won't compile unless I add the reference. Whereupon VS crashes. Wtf?
-
Tuesday, April 23, 2013 2:48 PMSame here!

