I've made a workflow in Designer which I invoke trough code in Visual studio. The solution is working fine in my Development machine, but when I implement to the production I get an error:
Object reference not set to an instance of an object.
Codesnippet for starting the workflow:
SPWorkflowAssociation wfAssoc = item.ParentList.WorkflowAssociations.GetAssociationByName(workflowname, System.Globalization.CultureInfo.CurrentCulture); item.Web.Site.WorkflowManager.StartWorkflow(item, wfAssoc, wfAssoc.AssociationData, true);