kamsar / Dianoga

An automatic image optimizer for the Sitecore media library.
Other
102 stars 45 forks source link

Could not load file or assembly 'System.Threading.Tasks.Dataflow #118

Closed stevenmcgowan closed 2 years ago

stevenmcgowan commented 2 years ago

While doing the Manual install and an install where I pulled the dll from a project via NuGet, I get the Could not load file or assembly 'System.Threading.Tasks.Dataflow error. I tried updating the System.Threading included package via NuGet as well as updating the reference manually to the correct version, but still run across the same error.

I am on Sitecore 10.1 and it looks like the latest version I've seen someone else reference is Sitecore 10.0. The .Net4.8 version is the one I used, same as our instance of Sitecore. Also, I updated the Kernel, MVC, and SXA references in the project to the one that is currently being use by the instance that throws the error.

Is there something else that needs updated to make sure I am using the right items to fix this error?

Error: Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Stack Trace: [FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.] Dianoga.Invokers.MediaCacheAsync.Pipelines.Initialize.MediaCacheReplacer.Process(PipelineArgs args) +0 (Object , Object ) +54 Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +490 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22 Sitecore.Nexus.Web.HttpModule.Application_Start() +146 Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +918 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +584 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +277 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +369

[HttpException (0x80004005): Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +724

markgibbons25 commented 2 years ago

System.Threading.Tasks.Dataflow, Version=5.0.0.0 is a dependency required by Dianoga. Is it possible you are already referencing a different version of that DLL in your solution? If so can you change it to 5.0.0.0?

stevenmcgowan commented 2 years ago

I was not referencing a different version, but instead, the Sitecore 10 solution did not have the dll included. I copied the missing System.Threading.Tasks.Dataflow.dll file to the Sitecore solution itself and this fixed the issue. My initial thought was any referenced dlls would be included in the Sitecore solution or the Dianoga solution. This was an incorrect assumption on my part.