Windows service not processing jobs from webapp

queues
aspnetcore
Tags: #<Tag:0x00007f49a41b8588> #<Tag:0x00007f49a41b8420>

#1

Hello there,

Just starting using Hangfire with asp.net core 2.2.
Since running my jobs in the webapp make it lag a bit, I’m trying to queue the jobs with the app, and process them with a windows service.

So, I’va commented the “app.UseHangfireServer()” in the Sartup.cs class.
Windows service is configured as mentioned in the doc and running well.
I can see the new server when going on the dedicated section in the dashboard, and it says it’s active.

but everytime I add a job to the queue, it throws me this :

> Could not load file or assembly 'Cri.Interactif.GenerateurCodes.Web, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
>    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
>    at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
>    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
>    at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
>    at Hangfire.Common.TypeHelper.AssemblyResolver(String assemblyString)
>    at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
>    at Hangfire.Common.TypeHelper.CachedAssemblyResolver(AssemblyName assemblyName)
>    at System.TypeNameParser.ResolveAssembly(String asmName, Func`2 assemblyResolver, Boolean throwOnError, StackCrawlMark& stackMark)
>    at System.TypeNameParser.ConstructType(Func`2 assemblyResolver, Func`4 typeResolver, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark)
>    at System.TypeNameParser.GetType(String typeName, Func`2 assemblyResolver, Func`4 typeResolver, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark)
>    at System.Type.GetType(String typeName, Func`2 assemblyResolver, Func`4 typeResolver, Boolean throwOnError)
>    at Hangfire.Common.TypeHelper.DefaultTypeResolver(String typeName)
>    at Hangfire.Storage.InvocationData.DeserializeJob()

Did anyone encountered this before? Is there a way to resolve this?
I assumed that I may have to reference my webapp project in my service project, but the service is targeting .net 4.7.2 when the web project is targeting .net core 2.1 so, it won’t work…