Domanda

Right now I'm trying to create a SharePoint 2010 Custom Timer Job in Visual Basic 2010, which doesn't want to register itself in the SharePoint Timer (it appears to add ok and everything, but doesn't show or do anything). Most of the code samples I've seen show C#, however I haven't seen anything explicitly saying Visual Basic not allowed. Are there any considerations for doing SharePoint custom timer jobs in Visual Basic, or is it just not doable?

The custom timer job is not visible in the Central Administration. The ULS logs have shown nothing out of the ordinary, but deployment appears succesful. Thoughts?

È stato utile?

Soluzione 3

While all the above are great responses, it turns out it was an error as apparently deploying to the Central Administration web application wouldn't work, but any another web application would. Strange.

Altri suggerimenti

The chosen language cannot be the reason why your job doesn't work. Regardless of language it compiles in the same MSIL. Did you check ULS for any errors related to your job? Did you check ULS settings - maybe it configured not to log some messages? Did you check job status in Central Administration?

There are two key points to the Timer Job. The class which represents the timer job, and then the code that actually registers the job. This is typically done within a feature receiver on the feature that contains the timer job.

Here is some code on MSDN: http://msdn.microsoft.com/en-us/library/cc406686.aspx#WSSCustomTimerJobs_DeployingCustomTimerJobs

The pseudo code reads like this:

  1. Create an instance of your class
  2. Create an instance of the SPMinuteSchedule/SPHourlySchedule/SPDailySchedule class
  3. Set properties like Begin, End, and Interval
  4. Set your job's schedule to the schedule object you configured
  5. call the Update method of your timer object

After that is done, once the feature is activated you should see it in the listing of jobs available in Central Administration. There are likely a LOT of registered jobs, it may be necessary to filter it based on the scope of the job in order to see it.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top