HangfireIO / HangfireIO/Hangfire

System.MissingMethodException: No parameterless constructor defined for this object.

Open
#1,176 1 comment 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

Good day.

I am having a strange issue that I cannot figure out.

I am getting the following exception on my background jobs that I am running:
`System.MissingMethodException: No parameterless constructor defined for this object.`

However the jobs still work. In my case the job is to send a SMS. My phone gets the sms. however the hang-fore dashboard sits and retry the jobs.

Below is my code:

```
///
/// Send sms to multiple numbers as a background task using hangfire
///
///
///
public static void SendSmsBackground(List numbers, string content, int? sensorAlertHistoryId = null)
{
foreach (var number in numbers)
{
BackgroundJob.Enqueue(() => SendSmsViaAPi(number, content, sensorAlertHistoryId).Wait());
}
}
```
all my parameters are simple type variables.

What could be causing this issue?

Contributor guide

Open the contributing guide

Research direction

Start with the BackgroundJob.Enqueue call in the reported SendSmsBackground method and trace how its expression is serialized and later executed. Compare the exception timing with the SMS method and the dashboard retry state; done requires a reproducible cause and a verified correction or clear documentation of the required job-construction behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend, distributed-systems
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.