Error - Could not load file or assembly 'System.Threading.Tasks, Version=2.5.16.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Any suggestions?

BenBoneyIII replied on Tuesday, April 16, 2013

mayurimalgave,

I had this same problem with an WPF/CSLA app after upgrading to CSLA 4.5.22. I think it has to do with Microsoft.BCL.Async. System.Runtime and System.Threading.Tasks are referenced in my WPF project. These references were added via Nuget when I upgraded CSLA from 2.5.10 to 2.5.22. However, in my case, ClickOnce does not recognize these assemblies as required files. So, the files were never pushed to the end user. This seems to be an issue with .NET 4 only, not 4.5.

My solution was to manually add those 2 dll's to the root of my project as Content. This forced ClickOnce to publish the files and then my app was happy. Perhaps your installation to the WCF "server" does not include these files?

QOfLight replied on Tuesday, April 16, 2013

I am also getting this, so if you solve, please let me know.

This is what I have tracked down thus far. Silverlight 5 Tools or SDK installs a different version of mscorlib which is 5.xxxxx, and there is another version 4.xxxxx which this project seems to have been compiled with. General rule is the most recent is used. I deinstalled silverlight 4 just in case.

I am trying to specify an assembly version for mscorlib in the web.config (either the one with CSLA or this newer one) but that did not fix it either.

It seems to me that something older (which could have been compiled to target a specific version is somehow loading the old 2.x mscorlib/ Threading which of course doesn't have .Tasks. If I get desperate I will have to install something that says who loaded which assembly.