views:

1134

answers:

8

I'm working on a moderately sized WebForms project. Due to the peculiarities of management here, I have to upload the site to a remote server in order to test (no localhost testing). I'm using the 'Publish' command in Visual Studio 2008. Sometimes, it even works. Most of the time, I inexplicably get a "publish failed" in the bottom left corner, with no further details.

The few googled articles/forum posts I read suggested making the target local folder for the publish operation readable/writable for everyone. Doesn't help.

Is there are way to get further details as to WHY a publish fails in VS2008, and if not, is there a better way of doing these deployments? I'm spending more time building/pushing to the web server than actually debugging.

+2  A: 

It happens to us when there is an error in markup (!). Bad thing is that VS will just swallow the error and just tell you Failed.

What I suggest is to run your publish from command line using MSBuild. It's not that straightforward but it works (once you get into it).

Rashack
+1  A: 

I mostly work with Web Forms, and I encounter this problem daily. It seems to me that publish fails when it fails to delete a file it is trying to replace. Even if I don't have any files open, it still fails sometimes. Not sure why. Not only VS publish fails very often, it is painfully slow as well. I just publish to empty local directory and use separate FTP client to upload files. It's more work, but works.

Brian Kim
+1  A: 

This is probably not the case for you, but I've seen this happen when I'm publishing a web site. If the app_offline.htm file is not excluded from your project (if you use this file), the publish will fail.

nickyt
A: 

After struggling with a similar issue for about 30 mins with no clue as to what was causing it closed down VS and reopened my project. Started working fine. No idea why but it worked.

philba888
+1  A: 

I've since discovered that the reason for these particular publish failures was due the "Delete Existing Files" option being checked. Using Visual Studio 2008 under a non-administrative account on Windows Vista could cause a permissions error while attempting to delete the existing files. The publish would fail silently after encountering a file that Visual Studio had insufficient access to delete. Once the files were deleted manually outside of Vidual Studio, the publish functioned normally.

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

JustinT
A: 

Same happened to me.. what I did was include images files that was not included in the project and delete images that were not used.

Fleents
A: 

hi

we are experiencing the same problems from clean win 7 installs on several new PCs (laptops and desktops)

we are experiencing 10x + publishing times (on a 2.66Ghz QUAD with 8GB mem compared to a 2GHz single CPU with 2GB of memory)

please provide us with additional strategies/diagnostics

thanks rob karatzas

[email protected]

Rob K
A: 

It's worth checking the output window. I've just had a publish fail because I had deleted an image outside of VS so VS was complaining that the image couldn't be found, but this information was only displayed in the output window.

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

Phil Hale