When creating a job in SQL Server 2005, if you get the following message:
Unable to cast object of type ‘Microsoft.SqlServer.Management.Smo.SimpleObjectKey’ to type ‘Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey’. (Microsoft.SqlServer.Smo)
Make sure the version of your client tools and server are the same. When you install SP2, the SP doesn’t automatically fix the client tools, too. In my case, the DB was SP2, but the client tools weren’t. Updating the client tools to SP2 fixed the problem.