question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not load file or assembly 'System.Threading.Tasks.Dataflow' when running from build server.

See original GitHub issue

I’ve wrote a small script that download SourceBrowser from NuGet and runs it daily on our build server - a Windows 7 server with .Net 4.6 installed (Windows 2008 R2 didn’t work either). I get this exception while it runs:

09:49:48 Failed to open solution: D:\Jenkins\Slave\job\solution.sln
System.IO.FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=4.5.24.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Threading.Tasks.Dataflow, Version=4.5.24.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Microsoft.Build.BackEnd.Logging.LoggingService.ProcessLoggingEvent(Object buildEvent, Boolean allowThrottling)
   at Microsoft.Build.BackEnd.Logging.LoggingService.LogInvalidProjectFileError(BuildEventContext buildEventContext, InvalidProjectFileException invalidProjectFileException)
   at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation)
   at Microsoft.Build.Evaluation.Project.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings)
   at Microsoft.CodeAnalysis.MSBuild.ProjectFileLoader.<LoadProjectAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.MSBuild.ProjectFileLoader.<LoadProjectFileAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.<LoadProjectAsync>d__40.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.<GetOrLoadProjectAsync>d__39.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.<OpenSolutionAsync>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.SourceBrowser.HtmlGenerator.SolutionGenerator.CreateSolution(String solutionFilePath, ImmutableDictionary`2 properties)

I solved this issue in another server by installing Visual Studio 2015 - is this required?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
drose-d2lcommented, Nov 9, 2015

You may need MSBuildTools 2015

0reactions
kobicommented, Nov 10, 2015

gacutil gives this output:

The Global Assembly Cache contains the following assemblies:
  system.threading.tasks.dataflow, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL

Number of items = 1

My solution does not require System.Threading.Tasks.Dataflow.dll. I also tried with another solution (VS 2015 solution, with just one project and a few files), and I’m getting the same error.

After installing Microsoft Build Tools 2015, gacutil looks better:

The Global Assembly Cache contains the following assemblies:
  system.threading.tasks.dataflow, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
  system.threading.tasks.dataflow, Version=4.5.24.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL

Number of items = 2

Now SourceBrowser can index the small solution, so the problem is solved. My solution has a new error, missing .targes file, but that is something I can solve (probably a wrong Condition in my .csproj). Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not load file or assembly System.Threading.Tasks. ...
IO.FileLoadException : Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=6.0.0.0, Culture=neutral, PublicKeyToken= ...
Read more >
Could not load file or assembly 'System.Threading.Tasks. ...
I'm using Unity + vs code + window 10. ... [warn]: OmniSharp.MSBuild.ProjectManager Failed to load project file 'c:\CYF\Unity\BehaviourTreeAI\ ...
Read more >
Could not load file or assembly or one of its dependencies. ...
I get Package 'System.Threading.Tasks.Dataflow:4.9.0' has no deliverable for platform 'net 4.7'. with the attached project.
Read more >
System.Threading.Tasks.Dataflow 7.0.0
TPL Dataflow promotes actor/agent-oriented designs through primitives for in-process message passing, dataflow, and pipelining. TDF builds upon the APIs and ...
Read more >
VS2017 failed to generate engine .sln:error MSB1025
FileNotFoundException : Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=4.5.24.0, Culture=neutral, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found