How do fix the error "could not be compiled. Try rebuilding from the source manually"


daebreaker

I know this is over a year old (and probably breaks some rules about digging up old threads to comment on), but I’m surprised that the situation I’m about to describe is not mentioned here because it’s something that legitimately could happen. More specifically, it’s the fact that this only works if you had at least one C++ file in the project before the problem occurred; if this is not the case, you unfortunately can’t generate a solution for Visual Studio because there’s literally nothing to include in one.

If this happens, just create a new project. Name it whatever you want (this will be changed later), then go into your old project and copy over the contents folder to the new project. Note that simply copying the C++ files to the old project and generating solution files from that won’t work - Visual Studio will only complain of missing files which can be confirmed in the solution explorer, but this unfortunately is not fixable as far as I know. Once the contents folder has been copied to the new project, delete the old one and rename the new project to whatever the old project was called. You can then open the new project, and everything should be good to go again.