When using Visual Studio 2008, when I "Publish Web Site", the application builds correctly, but then I get a "Publish failed" message:
What possible reasons are there for this, and how can I prevent it?
You can try this:
Perform precompilation against the web application.
Clear the target directory(virtual directory in IIS or physical file folder) and deploy all the files (of the web application) into the target directory.
In the output window you can check at which stage does the publish website operation fail. For example, at the first stage, if there are some error which will only occur at precompilation, that will cause the stage 1 fail. Or some times if the target directory has something configured incorrectly. Such as the IIS virtual dir is not set to the correct ASP.NET version or some old files are locked and prevent them from being cleared. Mostly, publish failed will be caused by IIS side configuration issue such as authentication setting....
You can open the output window by pressing
Ctl + w, o.