CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

CSLA .NET Resources:
  • CSLA .NET forum
  • CSLA .NET home page
  • Could not load file or assembly System.Threading.Tasks

    rated by 0 users
    Answered (Verified) This post has 1 verified answer | 4 Replies | 1 Follower

    Top 500 Contributor
    41 Posts
    mayurimalgave posted on Tue, Apr 9 2013 7:21 AM

    Hiii,

    I have created an application using CSLA & silverlight.

    I have used recent new dll from CSLA4.5 20

    I am getting the following error at the statement:

    DataPortal.BeginFetch<CompanyList>(callback);

    in Library project.

     

    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?

    Answered (Verified) Verified Answer

    Not Ranked
    1 Posts
    Verified by mayurimalgave

    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.

    Rocky ?

    Thanks,

    Mary

    All Replies

    Not Ranked
    3 Posts
    Suggested by Ben Boney

    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?

     

    Hope this helps

    Ben


    Not Ranked
    1 Posts
    Verified by mayurimalgave

    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.

    Rocky ?

    Thanks,

    Mary

    Top 500 Contributor
    41 Posts

     hi QOfLight,

    I solved this problem by doing following steps.

    1.Open Visual Studio.

    2.Go to Tools -> Library Package Manager -> Package Manager console.

    3.Run the following command:

    PM>Install-Package Microsoft.Bcl.Async

    For reference,follow a link: http://nuget.org/packages/Microsoft.Bcl.Async/

     

    Top 500 Contributor
    41 Posts

    Thanks Ben.

    But

    I solved this problem by doing following steps.

    1.Open Visual Studio.

    2.Go to Tools -> Library Package Manager -> Package Manager console.

    3.Run the following command:

    PM>Install-Package Microsoft.Bcl.Async

    For reference,follow a link: http://nuget.org/packages/Microsoft.Bcl.Async/

    Page 1 of 1 (5 items) | RSS

    Copyright (c) 2006-2014 Marimer LLC. All rights reserved.
    Email admin@lhotka.net for support.
    Powered by Community Server (Non-Commercial Edition), by Telligent Systems