In a MVC2 project I moved a file from App_code to Content folder and compiled it. Then move it back again to App_Code and then changed its Build Action to \"Compile\". Now I
I fixed this by checking Delete all existing files prior to publish in Visual Studio:
Delete all existing files prior to publish