Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Steinar's answer sent me in the right direction. Sharing the steps here that got QuartZNet to work in a medium trust hosting environment. </p> <p>QuartzNet initially ran into permissions issues on medium trust, we needed to the do the following to fix the issue </p> <p>(1) Downloaded QuartzNet code ( 2.1.0.400 ) from github and build it after making the following changes to AssemblyInfo.cs</p> <p>Replaced</p> <pre><code>#if !NET_40 [assembly: System.Security.AllowPartiallyTrustedCallers] #endif </code></pre> <p>with</p> <pre><code>[assembly: AllowPartiallyTrustedCallers] #if NET_40 [assembly: SecurityRules(SecurityRuleSet.Level1)] #endif </code></pre> <p>(2) Downloaded C5 code (v 2.1) and built it with </p> <pre><code>[assembly: AllowPartiallyTrustedCallersAttribute() </code></pre> <p>Ensure C5 is compiled in the same .NET version as Qartznet. </p> <p>(3) Added the quartz section to web.config within TGH, section had requirepermission set to false. Common logging section also had requirepermission set to false, also configured it to use Common.Logging.Simple.NoOpLoggerFactoryAdapter. </p> <pre class="lang-html prettyprint-override"><code>&lt;configSections&gt; &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt; &lt;sectionGroup name="common"&gt; &lt;section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" requirePermission="false" /&gt; &lt;/sectionGroup&gt; &lt;section name="quartz" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt; &lt;/configSections&gt; &lt;common&gt; &lt;logging&gt; &lt;factoryAdapter type="Common.Logging.Simple.NoOpLoggerFactoryAdapter, Common.Logging"&gt; &lt;arg key="showLogName" value="true" /&gt; &lt;arg key="showDataTime" value="true" /&gt; &lt;arg key="level" value="OFF" /&gt; &lt;arg key="dateTimeFormat" value="HH:mm:ss:fff" /&gt; &lt;/factoryAdapter&gt; &lt;/logging&gt; &lt;/common&gt; &lt;quartz&gt; &lt;add key="quartz.scheduler.instanceName" value="QuartzScheduler" /&gt; &lt;add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" /&gt; &lt;add key="quartz.threadPool.threadCount" value="10" /&gt; &lt;add key="quartz.threadPool.threadPriority" value="2" /&gt; &lt;add key="quartz.jobStore.misfireThreshold" value="60000" /&gt; &lt;add key="quartz.jobStore.type" value="Quartz.Simpl.RAMJobStore, Quartz" /&gt; &lt;/quartz&gt; </code></pre> <p>(4) Initialised the scheduler using constructor with namecollection as the parameter, namecollection was the quartz section picked up from web.config. </p> <p>In global.asax</p> <pre><code>QuartzScheduler.Start(); </code></pre> <p>The class</p> <pre><code>public class QuartzScheduler { public static void Start() { ISchedulerFactory schedulerFactory = new StdSchedulerFactory((NameValueCollection)ConfigurationManager.GetSection("quartz")); IScheduler scheduler = schedulerFactory.GetScheduler(); scheduler.Start(); IJobDetail inviteRequestProcessor = new JobDetailImpl("ProcessInviteRequest", null, typeof(InviteRequestJob)); IDailyTimeIntervalTrigger trigger = new DailyTimeIntervalTriggerImpl("Invite Request Trigger", Quartz.TimeOfDay.HourMinuteAndSecondOfDay(0, 0, 0), Quartz.TimeOfDay.HourMinuteAndSecondOfDay(23, 23, 59), Quartz.IntervalUnit.Second, 1); scheduler.ScheduleJob(inviteRequestProcessor, trigger); } } public class InviteRequestJob : IJob { public void Execute(IJobExecutionContext context) { RequestInvite.ProcessInviteRequests(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload