HangfireIO / HangfireIO/Hangfire

Could not make an assembly reference to mscorlib problem

Open
#2,240 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

I'm building an application with .NET 7 and using the latest hangfire release 1.8.3, I'm running to an issue where after registering hangfire services whenever I run the application or a background job triggers I get the following error in the logs

> Could not make an assembly reference to mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561
> 934e089
>
> System.IO.FileNotFoundException: Could not load file or assembly 'System.Security.Permissions, Version=0.0.0
> .0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
> File name: 'System.Security.Permissions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
> at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, StackCrawlMark& stackMark, A
> ssemblyLoadContext assemblyLoadContext, RuntimeAssembly requestingAssembly, Boolean throwOnFileNotFound)
> at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
> at JasperFx.RuntimeCompiler.AssemblyGenerator.ReferenceAssembly(Assembly assembly)

can someone shed some light on this?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with .NET 7 and Hangfire 1.8.3 after registering Hangfire services. Trace the reported failure through JasperFx.RuntimeCompiler.AssemblyGenerator.ReferenceAssembly and determine whether the missing System.Security.Permissions assembly or the mscorlib reference causes it. Done means the application and a triggered background job run without these assembly-loading errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.