I created a site and when I try to publish it, I receive a error:
Unable to remove directory "obj\Release\AspnetCompileMerge\TempBuildDir". The folder is not empty
The build and rebuild occurs ok, but not the publish.
I can't find the folder to clear it. How can I fix that error?
This issue is related to the local files inside Your solution/project
. Anything in the "obj" folder is used by Visual Studio, during building the project/putting code together. It seems that at some moment, VS is trying to delete these files, but some process is still running and the VS is not allowed to delete it.
As suggested from the comments, restarting Visual Studio and/or Cleaning the Solution works most of the time.
However from time to time, some other processes can touch these folder structure. In such case You should find this process/application and stop it. Or simply restart the computer (it stops all actually running processes), on fresh start You should be allowed to run the publish action as before.