If you don't know how to make a CTJ? Take a look at: Example of a Custom Timer Job
How to debug a Custom Timer Job?
After installing and activating the CTJ - Feature
(Make sure that the code in the execute() method runs every minute. It takes less time to debug)
- Set a breakpoint somewhere in your code.
- Click 'Debug' in the toolbar (Visual Studio 2005)
- Click 'Attach to process'
- Select 'OWSTimer.exe'
- Everytime the code is being executed, the debugger starts working.
- Now you can enjoy 'debugging'
How to access the web.config within a Custom Timer Job?
Configuration config =
WebConfigurationManager.OpenWebConfiguration("/", "Sharepoint - 80");
string value = config.AppSettings.Settings["keyName"].value;
Hope , these tips save some developer time :)
No comments:
Post a Comment