Search code examples
c#hangfire

How to return a return value from Hangfire


I noticed this field in the Hangfire Dashboard for a succeeded job:

enter image description here

I would love to shove some data in there, to give me more information about what the job did.

How would I do that?

I have searched google, checked the Hangfire documentation etc, but with no luck - probably because "result" is a very tricky keyword to search for in this context.


Solution

  • The "Result" field displays the output/result your method returns.

    You can return a string or object and Hangfire will convert it to JSON.

    Your "Result" field contains a serialization error, Hangfire is failing to serialize the returned object but without any code I cannot help you further.

    Please see example screenshots below.

    Code: Result: Code: Result: