Failed to execute the Publish command of Visual Studio

I am working on a moderate sized WebForms project. Due to the management features here, I have to upload the site to a remote server in order to check (no localhost testing). I use the Publish command in Visual Studio 2008. Sometimes this works. In most cases, I inexplicably get "publication failed" in the lower left corner, without further details.

Several articles in googled / posts that I read suggested making the target local folder for the publish operation read / write for everyone. Does not help.

Is there a way to get more detailed information about WHY the publication failed in VS2008, and if not, is there a better way to do these deployments? I spend more time creating / clicking on a web server than actually debugging.

+6
c # visual-studio-2008 visual-studio publishing
source share
10 answers

This happens to us when an error occurs in the markup (!). The bad news is that VS just swallows the error and just tells you that you worked.

I suggest starting publishing from the command line using MSBuild. It is not so simple, but it works (as soon as you get into it).

+3
source share

It is worth checking the output window. I just posted a crash because I deleted the image outside of VS, so VS complained that the image could not be found, but this information was displayed only in the output window.

See this link for more information: http://ericfickes.com/2009/08/find-out-why-visual-studios-publish-fails/

+4
source share

Since then, I have discovered that the reason for these specific publication failures is to check the Delete existing files checkbox. Using Visual Studio 2008 under an unauthorized account in Windows Vista may cause a permission error when trying to delete existing files. Publishing failed after encountering a file that Visual Studio did not have enough to delete. Once the files were manually deleted outside of Vidual Studio, the publication functioned normally.

I did not have this problem with Windows 7; I assume that the UAC changes in Windows 7 fixed the problem.

+2
source share

I mainly work with web forms, and I run into this problem every day. It seems to me that the publication fails when it is not possible to delete the file that it is trying to replace. Even if I do not have open files, it still fails. I do not know why. Publishing is not only very common, but also very slow. I just publish to an empty local directory and use a separate FTP client to upload files. It works more, but it works.

+1
source share

It may not be so, but I have seen it happen when I publish a website. If the app_offline.htm file is not excluded from your project (if you use this file), the publication will fail.

+1
source share

The same thing happened to me .. what I did was include image files that were not included in the project, and delete images that were not used.

+1
source share

After you encountered a similar problem for about 30 minutes, having no idea what led to VS closing and resuming my project. Started to work perfectly. I donโ€™t know why, but it worked.

0
source share

You should always stop the IIS instance on the computer on which you are publishing. Google the word "iisreset". Other hosting providers, such as DiscountAsp and Arvixe, offer you tools to "Stop" and "Start" your application pool on their IIS remotely. This is very necessary because IIS can lock some files as being "used", so your publication crashes when it tries to write them. When the publication is complete, just restart IIS (or click "Start" from the web tool if you are using a third-party hosting provider).

When all else fails, check the "Exit" window (the tab to the right of your "error list" at the bottom of Visual Studio). Scroll through all this after a failed post and find something that says "Unable to add." If you continue to see the same "Unable to add" errors in the same edition, then ftp to the folder, delete the problematic files manually and re-post.

0
source share

I got this when the ProjectName.Publish.xml file was read-only. As soon as I checked the file from the control source, I no longer received the error and could publish.

0
source share

Just to add to this topic, I found that for some bizarre reason, only Mercurial files are published to the server, everything else is simply not copied.

Another strange thing was that only the Debug configuration is available; Release was nowhere to be seen.

After reading the other topics around SO, I found that there were many for VS 2010 and 2012, but not so many to cover the same problem since 2008.

The fix I found was to delete the [solution] file. suo and then try to publish. It seemed to do the job, although it took a long time.

0
source share

All Articles