Skip to content

Help needed - System.NullReferenceException: Object reference not set to an instance of an object. #2139

Closed Answered by swidz
swidz asked this question in Q&A
Discussion options

You must be logged in to vote

For posterity,
I have found the solution. The issue was how assembly list was loaded that was passed to services.AddSilkierQuartz
To create that list, I used a helper method that internally used System.Reflection.Assembly.Load(assemblyName)
or System.Reflection.Assembly.LoadFile(assemblyPath)

but instead it should use

System.Runtime.Loader.AssemblyLoadContext.Default.LoadFromAssemblyName(assemblyName) or
System.Runtime.Loader.AssemblyLoadContext.Default.LoadFromAssemblyPath(assemblyPath).

References:
About System.Runtime.Loader.AssemblyLoadContext

Regards,
Sebastian

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by swidz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant