1

I have created a timer job which was deploying and working without any problems.

I then created a second job in the same feature and had some problems deploying it, but after restarting Visual Studio this deployed correctly.

Now though, both jobs are failing when they are executed as the Guid that is being passed to the execute methods seems to be wrong. There is only one DB and the Guid that is being passed is incorrect.

Can anybody tell me why the GUID may be incorrect?

1

the best approach is to create each SharePoint timer job in a separate feature.xml. In each feature.xml you can specify the scope of the job, unique id, and receiver class for the job. Here are two sample feature.xml that you may need to get an idea. Of course, you can package both these features in the same Class Library -> then to WSP.

<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
         Id="1DB91AA4-C699-4499-B1BD-67583ABB1EE2"
         Title="job 1"
         Description="job 1 description."
         Scope="Site"
         Hidden="TRUE"
         Version="1.0.0.0"
         ReceiverAssembly="Myassembly.Platform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f5afeac9a8e5e1b0"
         ReceiverClass="Myassembly.Platform.Job_1_Installer">    
</Feature>



<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
         Id="20D74316-6E1F-4582-9F27-FC729E231956"
         Title="My job 2"
         Description="job 2 description"
         Scope="Site"
         Hidden="TRUE"
         Version="1.0.0.0"
         ReceiverAssembly="Myassembly.Platform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f5afeac9a8e5e1b0"
         ReceiverClass="Myassembly.Platform.Job_2_Installer">

 <Properties>
    <Property Key="BeginMinutes" Value="5;10;15;20;25;30;35;40;45;50;55" />      
  </Properties>
</Feature>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy