Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when publishing my site

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?

like image 918
Italo Rodrigo Avatar asked Sep 19 '25 05:09

Italo Rodrigo


2 Answers

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.

like image 137
Tatranskymedved Avatar answered Sep 21 '25 20:09

Tatranskymedved


Delete the (TemporaryGeneratedFile) from your \obj\Release you will find three files after delete it try to publish and till us what happened

like image 33
Hamza Yahia Avatar answered Sep 21 '25 21:09

Hamza Yahia