I have a Feature with an event receiver (written in c#), which for the sake of brevity creates a list which is a data store for a form on a custom web part. I have ps1 scripts which retract and deploy my solution and up until recently, this process has worked with no issues. Recently, however, I have had to add a new field to the list. So I used the same logic to add the new field following the same code logic that I have used for the other list fields. When going through the form to submit to the list I get the error:
Column 'MyNewColumn' does not exist. It may have been deleted by another user
Weirdly enough, if I deactivate the feature and reactivate via the UI, the error does not appear and everything works as expected. I am not sure why this is happening on initial activation. Why is it referencing the old list schema even though the solution is retracted and the DLL is removed from the GAC before another deployment is made? I have spent hours trying to figure this out, hopefully someone out there can assist.