2

We have been using the ftp publishing method to upload our site to an external server. But have recently discovered that some of the JavaScript files that have been changed are not being updated when published. We have checked on the server to verify if the files have been uploaded and only found the old versions, so it's not a cache issue.

Additional Information:

  • We are using Visual Studio Team Services
  • We are using ASP.NET MVC.
  • We have the 'Exclude files from the App_Data folder' File Publish Option checked.

We are not sure what is causing this to happen but suspect that the issue might be caused by source control. That the files that have been worked on and checked in on one machine are not seen as having been changed by the Visual Studio on the machine doing the publication.

We've found this question Content files not updating with Visual Studio 2010 FTP Publish that seems to relate to the issue we're having but would prefer not to have to use the workarounds provided.

Is there a other way to fix or avoid this issue?

Community
  • 1
  • 1
FJvdM
  • 135
  • 1
  • 8
  • Did you right click on your solution/project and select "Get Latest Version" to make sure that your local source code has already included the latest changes before publish it? – Eddie Chen - MSFT Jun 08 '16 at 01:50
  • Hi @Eddie-MSFT. Yes we did get the latest version before publishing. We also tried getting the latest version and publishing again once we noticed the issue but it still did not update the files. – FJvdM Jun 08 '16 at 11:23
  • Can you check the properties of these files? What's the value for "Build Action"? – Eddie Chen - MSFT Jun 13 '16 at 02:43
  • @Eddie-MSFT - All the files have a "Build Action" value of "Content". – FJvdM Jun 13 '16 at 10:38
  • If you right click on the file and select "Preview changes to xxx", can it show the changes correctly? – Eddie Chen - MSFT Jun 14 '16 at 02:54
  • @Eddie-MSFT - No changes are shown, as the files have already been checked into source control. – FJvdM Jun 22 '16 at 14:34
  • The preview changes option does not compare the local file with the one in source control. It compares the local file with the one in published FTP server. – Eddie Chen - MSFT Jun 27 '16 at 06:17
  • I've been having the same issue, except that I don't use source control for the project. The problem is intermittent; it happens 5% or 10% of the time, and happens with different files each time. It looks pretty random. – perfect_element Oct 28 '16 at 07:00
  • @perfect_element - Same problem here, so far exclusively with .aspx or .ascx files, not very often (maybe one file every 10 publish) but very annoying since it's random (not the same file each time). I use git but i'm positive the files are always up to date, and i publish via FTP. – Jean Robert Jan 12 '17 at 18:22

1 Answers1

0

I've been experiencing this off-and-on with file system publishing. Out of pure desperation I created a new publish profile and...it worked.

It appears to be related an issue with the .user file that's created for the publish profile. While not a solution, a workaround at least can be to remove the .user file if a problem is encountered.

Related question: Visual Studio 2012 Web Publish doesn't copy files

Paul K
  • 98
  • 2
  • 8