I have modified a SharePoint visual studio workflow which works as per requirement on the dev machine. I have to deploy it to an email enabled document library on sharepoint server and it is set to be started automatically when a new item is added to the library. When i deploy it to the server, and perform a manual upload to the doc library i.e. use the upload button to uplaod a document, it runs as expected. but when an email is received by the document library, a previous version of the workflow runs. this is really frustrating. I have removed all the previous versions of the workflow and now there is only one left. I have tried removing the workflow and adding it again but still the same behavior. I have removed temporary .net files from the windows folder but no luck.
If the new version is not installed properly, why is the manual upload working fine? can someone help? I want the same version of the workflow to run on the manual upload and email.