UBT ERROR: Failed to produce item: dll after deleting classes

I tried to delete some c++ classes from my project following the instructions on this question: How do I remove a C++ class from my project code? - C++ - Epic Developer Community Forums

Now when I try to open the project I get a message that it can’t find UE4Editor-Project_Name.dll and asks if it wants to rebuild. When it rebuilds it says the project can’t be compiled and must be rebuilt manually. In visual studio I try to rebuild the project and it gives me the following error.

Tool : error : UBT ERROR: Failed to produce item: filepath\UnrealProjects\Project_Name\Binaries\Win64\UE4Editor-Project_Name.dll

I have found some people with similar problems, but their solutions haven’t worked yet. Does anyone know how to fix this?

UPDATE: I realized that the dll file is still in my recycle bin. I retrieved the file and placed it in the location it was expected to be in (this was the only file in the directory). When I built the project in VS it gave me the same error. When I reopened the directory, the dll file had vanished (and its not in my recycling bin anymore; the entire directory is empty now).