Hangfire
Hangfire copied to clipboard
why the .net core version dashboard not support cronDescription
i saw the code in https://github.com/HangfireIO/Hangfire/blob/master/src/Hangfire.Core/Dashboard/Pages/RecurringJobsPage.cshtml
<td class="min-width">
@* ReSharper disable once EmptyGeneralCatchClause *@
@{
string cronDescription = null;
#if NETFULL
try
{
cronDescription = string.IsNullOrEmpty(job.Cron) ? null : CronExpressionDescriptor.ExpressionDescriptor.GetDescription(job.Cron);
}
catch (FormatException)
{
}
#endif
}
@if (cronDescription != null)
{
<code title="@cronDescription">@job.Cron</code>
}
else
{
<code>@job.Cron</code>
}
</td>
why we need add #if NETFULL ?
the code block will work fine in .net core. Can I create a PR to remove this condition?
Resurrecting this issue. I was looking into creating a PR for this but found some things it would be good to get some background on the reasoning for.
The GetDescription
method in Cron.cs
is marked obsolete, presumably because the CronExpressionDescriptor
package is only referenced for net framework builds.
The version of CronExpressionDescriptor
referenced is 1.12.0 which didn't support netstandard or later. However the latest version appears to do so.
Do the maintainers agree a fix for this would be to update the CronExpressionDescriptor
package, remove the feature pre-processor and obsolete attributes to allow the cron description to work on net core?