Been struggling with this problem for a while. I'm deploying a custom timer job to SharePoint Foundation 2010, initially using the tutorial here. This timer job is supposed to add an element to a SharePoint list every 5 minutes. I haven't explicitly defined a separate SharePoint project for the timer job, I'm adding it through my existing project.
I have one class, TlJob, which overrides SPJobDefinition and contains the code to be executed, and a feature TlJobFeature implementing the event receivers that add TlJob to the web application's job definition list.
As far as I can tell from the logs, the feature is deployed correctly when I build and deploy the solution. The TlJobFeature feature is added to the Site Collection Features and marked as activated, and it also shows up in Central Administration. However, no new elements are added to the specified list. The log file shows a number of error messages like these:
04/12/2011 08:55:40.90 OWSTIMER.EXE (0x07B0) 0x0DD4 SharePoint Foundation Topology umbo High The type MonitorDisplayPages.TlJob, MonitorDisplayPages, Version=126.96.36.199, Culture=neutral, PublicKeyToken=991fdf04053037d6 could not be found in its specified assembly. Scanning all assemblies that have been loaded in the current app domain. 04/12/2011 08:55:41.47 SPUCHostService.exe (0x04E8) 0x1A14 SharePoint Foundation Topology umbp High The type MonitorDisplayPages.TlJob, MonitorDisplayPages, Version=188.8.131.52, Culture=neutral, PublicKeyToken=991fdf04053037d6 (Id = 43ce829d-8acd-3582-920d-e5e658cce2a2) could not be located in any loaded assembly.
It would seem like the code for the TlJob class might not have been deployed to the GAC, so I added the following line to the post-build script:
@echo *** Adding assembly to GAC "$(FrameworkSDKDir)bin\gacutil.exe" /i "$(TargetPath)"
However, this doesn't solve the problem. Searching google for the error message above returns only a single result, with three or four people having the problem and no responses.