You can use the clean option available in the Servers view to remove any invalid resources from the server before doing a full republish. This helps remove by-products generated as a result of the publishing process. When you find there is old code or an invalid state of code running on the server, try using this clean option to see if this helps remove these invalid states from the server.