What I did:
- Create an Empty SharePoint Project
- Create a simple Text Field
- Test - (re)deployment and retraction of Solution are causing no problems
- Create Content Type which consists of this one simple Text Field
- Test - still no problem with (re)deployment and retraction
- Create a List Definition and Instance which now uses the created Content Type
Now comes the problem. Deployment and retraction work for the first time but as soon as I try to redeploy the Solution SharePoint is able to delete the List Definition and Instance but not the Content Type. When I try to delete the Content Type via the Web UI I get an error that this Content Type belongs to an application Feature. Disabling the Feature doesn't remove the Content Type. Deleteting the List which uses the Content Type (and making sure the Content Type had an Usage of 0; also deleting the List from Past Bin/ SiteCollection Paste Bin) didn't help. Googling half the day (reading here, here and here) and trying different things I was able to delete the Content Type after setting "IsFromFeature" in the Content Database (I know this should be the last approach). After deleting the Content Type the next deployment works without problems but when I retract the Solution and try to redeploy it, I get the old behaviour.
Did I do anything wrong with the order of deployment? How can safely deploy Fields, Content Types and List Definitions/Instances without being unable to redeploy them?