none
Error building Dot net core 2.0 web app. RRS feed

  • Question

  • Hi,

    I'm building an inherited dot net core 2.0 web app. When I go to run it I receive this error "Could not load file or assembly 'System.Threading, Version=4.1.0.0, in the main function of the program file. Any Ideas what I am missing, I have the 2.0 core runtime and SDK on my machine.

    Thanks!

    Mike

    Thursday, October 19, 2017 7:45 PM

All replies

  • Hi Tanker 61,

    Welcome to MSDN forum.

    According to the error log, "Could not load file or assembly 'System.Threading, Version=4.1.0.0". That means this project missing the assembly "system.threading". So you can use NuGet to install this package to you project.

    Tools->NuGet Package Manager->Package Manager Console, input below command line on the Package Manager Console window:

    Install-package System.Threading

    After installation complete, check if it works fine.


    MSDN Community Support Please remember to click Mark as Answer. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, October 20, 2017 9:49 AM
  • I tried adding that assembly and am receiving the same error the full error is


    System.IO.FileLoadException was unhandled
      FileName=System.Threading, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
      FusionLog=""
      HResult=-2146234304
      Message=Could not load file or assembly 'System.Threading, PublicKeyToken=b03f5f7f11d50a3a, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
      Source=System.Diagnostics.DiagnosticSource
      StackTrace:
           at System.Diagnostics.DiagnosticListener..ctor(String name)
           at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices()
           at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
           at PayHubWebClient.Web.Program.Main(String[] args)
      InnerException:

    Friday, October 20, 2017 5:01 PM
  • @Tanker 61, According to the error log, “The located assembly's manifest definition does not match the assembly reference”, maybe the web.config had an older version number embedded in it somewhere, so please open your web.config, check the if exist similar code:

      <dependentAssembly>
        <assemblyIdentity name="System.Threading" publicKeyToken="xxx" />
        <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>

    If yes, please change the newVersion="4.3.0.0"

    Besides, you can try to delete the assembly and associated files from your projects bin folder.


    MSDN Community Support Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, October 23, 2017 9:12 AM