In many cases you may have multiple web applications running on the same machine simultaneously. When using attach to process debugging approach, you need to know the exact process id of the application you are debugging. This command will do this work for you:
This error happens often on the development Sharepoint 2010 machine after upgrade from sharepoint 2007 when trying to deploy solution from Visual Studio. In my case, the problem was related to incorrect upgrade of sharepoint publishing feature. It was upgraded with the feature activated. To correct the issue, it was sufficient to deactivate the publishing feature and reactivate it.
While migrating from Sharepoint 2007 to Sharepoint 2010 there was a custom workflow which used workflow status column in its logic. It was critical to have this column created when associating workflow with the list. Initially using standard technique of adding workflow association I could not get this column created automatically. The trick was to have StartCreate property set to true when creating workflow association.