Вопрос

After upgrading my Application to ASP.NET MVC 5 (.NET 4.5), I get the following error when creating a Scheduler client:

Type 'System.Web.HttpContextWrapper' in Assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable.

The exception is thrown here:

var sf = new StdSchedulerFactory();
var sched = sf.GetScheduler();

The Web.Config:

<quartz>
  <add key="quartz.scheduler.instanceName" value="RemoteClient" />
  <add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
  <add key="quartz.threadPool.threadCount" value="5" />
  <add key="quartz.threadPool.threadPriority" value="Normal" />
  <add key="quartz.scheduler.proxy" value="true" />
  <add key="quartz.scheduler.proxy.address" value="tcp://127.0.0.1:555/QuartzScheduler" />
</quartz>
Это было полезно?

Решение

Quartz.NET should definitely work inside ASP.NET (MVC) application with .NET 3.5, 4.0 and 4.5. There should be no place where HTTP context would be serialized.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top