To give some background, I am an ASP.net developer tasked with creating a calender event notification system with a lot of features beyond the out of the box calender. My application would read a list of SPList items, and send an email depending on some business criteria. So far, I was able to connect to the SharePoint and run all of my needed tasks using a console application.
My next step is to automate the process to run application daily and that is where I am stuck trying to convert this console application to an automated SharePoint feature (if I am using my terminology correctly).
I tried following tutorials (This is the one I am following now) but I am having problems with the deployment part as I never done this before. I can not seem to find any tutorials describing the deployment process. So far, my application just adds a new item to the list.
public override void Execute(Guid contentDbId)
{
// get a reference to the current site collection's content database
SPWebApplication webApplication = this.Parent as SPWebApplication;
SPContentDatabase contentDb = webApplication.ContentDatabases[contentDbId];
// get a reference to the "Tasks" list in the RootWeb of the first site collection in the content database
SPList taskList = contentDb.Sites[0].RootWeb.Lists["Tasks"];
// create a new task, set the Title to the current day/time, and update the item
SPListItem newTask = taskList.Items.Add();
newTask["Title"] = DateTime.Now.ToString();
newTask.Update();
}
I am using VS2007 and my sharepoint is 2007
Here are my questions: 1- How can I build a .dll to move to the GAC without having a static void Main(string[] args) in my class? Am I using a wrong project file? 2- Given that I got the .dll, how can I create a feature?
Any help (or terminology correction) would be appreciated. I feel like this should be an easy task for someone who knows what they are doing. I just need some direction on what to do.