I have a VB.NET application that's crashing with the following error:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks, Version=2.5.19.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Threading.Tasks, Version=2.5.19.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
I'm trying to use the Microsoft.Bcl.Async library. I've installed it via Nuget on the project that actually uses Async/Await calls and the project that references it. Everything works perfectly on my computer, but when I publish and test on another computer, my program crashes when I try to use the portion of it that's using Async/Await.
System.Threading.Tasks is referenced in both projects with Copy Local set to true. Microsoft.Threading.Tasks is referenced in both projects with Copy Local set to true. I've seen the other thread about this and it's installed in the relevant projects. These are the lines contained in my app.config file:
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.5.19.0" newVersion="2.5.19.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.5.19.0" newVersion="2.5.19.0" />
</dependentAssembly>
What am I missing with setting this up? Please let me know if you need more info. Thank you!
Click once will only include 3 main DLL's
Microsoft.Threading.Tasks.dll
,Microsoft.Threading.Tasks.Extensions.dll
, andMicrosoft.Threading.Tasks.Extensions.Desktop.dll
However, there are some more DLL's that are two more dependencies that are added when you add the nuget package that are not included in the distributable
System.Runtime.dll
andSystem.Threading.Tasks.dll
You can see that thePath
property for those two refrences are inside your project, not in the normal location.I am not entirely sure how to fix it, but at least now you know what the problem is.