I built an empty scheduler module to add to the scheduler, per the latest documentation and as posted on http://www.wwwcoder.com/tabid/68/type/art/parentid/224/site/6401/default.aspx
Here's my code:
Imports
System.Configuration
Imports DotNetNuke
Imports System.Web
Namespace
MyProject
Public Class MemberSyncScheduler
Inherits DotNetNuke.Services.Scheduling.SchedulerClient
Public Sub New(ByVal objScheduleHistoryItem As DotNetNuke.Services.Scheduling.ScheduleHistoryItem)
MyBase.new()
Me.ScheduleHistoryItem = objScheduleHistoryItem
End Sub
Public Overrides Sub DoWork()
Try
Me.Progressing()
NewTest()
Me.ScheduleHistoryItem.Succeeded = True
Me.ScheduleHistoryItem.AddLogNote("MemberSync updated successfully")
Catch ex As Exception
Me.ScheduleHistoryItem.Succeeded = False
Me.ScheduleHistoryItem.AddLogNote("EXCEPTION: " + ex.ToString)
Me.Errored(ex)
End Try
End Sub
Private Sub NewTest()
' do nothing
End Sub
End Class
End Namespace
I compiled it (no errors) with the dll ending up in the bin directory. Then I added it to the scheduler to my website:
Full Class Name and Assembly: MyProject.MemberSyncScheduler, MemberSyncScheduler
Schedule Enabled: Yes
Time Lapse: 2 minutes
Retry Frequency: 10 minutes
Retain Schedule History: 25
Run on Event: None
Catch Up Enabled: (not checked)
Object Dependencies: (none)
Run on Servers: localhost
But as soon as I update it, I get an unhandled exception ('System.NullReferenceException') occurred in aspnet_wp.exe[372].
Followed by these twp pop-up windows:
An unhandled exception of type 'System.NullReferenceException' occurred in DotNetNuke.DNNScheduler.DLL
Additional information: Object reference not set to an instance of an object.
An unhandled exception of type 'System.NullReferenceException' occurred in Unknown Module.
Additional information: Object reference not set to an instance of an object.
Then the website dies with this error:
Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable.
Please hit the "Refresh" button in your web browser to retry your request.
Administrator Note: An error message detailing the cause of this specific request failure can be
found in the application event log of the web server. Please review this log entry to discover what
caused this error to occur.
I have to remove the entry in the Schedule table to get the website back up.
What do I need to do/add/change to make the scheduler take my new schedule task? Help!!!
- LL