Reputation: 12205
I work on an ASP.Net project which we build with VS 2010. We use the "Publish" option from the Build menu to publish the application to a folder on our local server.
This works fine for one of our servers - the files copy over correctly, and everything works (we don't delete the files on the server prior to publishing, because there are extra files that don't come from VS). However, on our other server, the publish doesn't seem to work. The DLLs don't get replaced, which means we have to manually copy over the contents of the /obj/Debug/Package/PackageTmp
directory from the solution (which is where VS publishes all files to prior to copying them over).
The times on the server and local machine are both the same - both are synced to the same NTP server on the local network, so this is not the issue.
Is there anything that we can do to force VS to overwrite all the files in the destination directory (without actually deleting the files)?
Upvotes: 2
Views: 587
Reputation: 88074
I've frequently run into this and have come to the conclusion that VS's publish command is simply broken. Sometimes it works, sometimes not. I've even raised some MS Connect issues on it.
The problem goes back to at least VS 2005, maybe before.
Usually it boils down to the remote server being slightly ahead in it's time. However, it looks like you've already looked into that. We've also seen it fail to publish a changed .aspx page even when the times were identical on the two machines...
To resolve this, we publish to an empty temporary directory then issue a command to xcopy the files to the real target location. Once the xcopy is complete we clear out the temp directory.
Upvotes: 2