I am using quartz.net to schedule regular events within asp.net mvc application.
The scheduled job should call a service layer script that requires a UrlHelper instance
You need a RequestContext
to create a UrlHelper. In one of my HtmlHelper extension methods, I do it like this:
public static string ScriptUrl(this HtmlHelper html, string script)
{
var url = new UrlHelper(html.ViewContext.RequestContext);
...
}
How you get the RequestContext
is dependent on your application.