31

I'm deciding whether to add a file to version control. It's name ends with .pubxml.user. Can anyone tell me what it is? The fill name of the file is <name of our web server>.pubxml.user. It is evidently related to the publishing configuration.

The project is in ASP.NET MVC and C#, using Visual Studio 2013. the file is in the PublishProfiles folder.

Tim
  • 1,755
  • 2
  • 22
  • 34
  • 5
    I came looking for the answer too, but all I found so far is this comment `For each .pubxml file there is a .pubxml.user file. The .pubxml.user file contains the encrypted password if you selected the Save password option, and by default it is excluded from the project.` located at http://www.asp.net/mvc/tutorials/deployment/visual-studio-web-deployment/deploying-to-production – Justin Skiles Jun 29 '14 at 00:25
  • 1
    Annoyingly it's updated when publishing, like it combines config (should be added to VCS) and build results (optional in VCS). – William T. Mallard Mar 18 '15 at 20:22

1 Answers1

25

Because this is a user-specific file, it should be excluded from version control. From https://msdn.microsoft.com/en-us/library/ff398069(v=vs.110).aspx, emphasis mine.

When you create a publish profile, two files are created in the PublishProfiles folder: .pubxml and .pubxml.user. The .pubxml.user file contains only a few settings that apply to a specific user, such as an encrypted password. By default it is not included in source control. Typically when you change settings related to a profile you edit the .pubxml file rather than the .pubxml.user file.

Tyler Forsythe
  • 1,471
  • 17
  • 22
  • What drives me nuts is it somehow creates this password for the user without telling the user what it is. So it's not a real password entered by the user, in the case where the Azure publish wizard was used, the password magically appears in this file without the user typing it in. I wonder if it's really the user's azure account password, or if it's something else. – Warren P Jan 06 '16 at 20:38
  • 2
    @WarrenP If this is an azure website (web app currently) the password should have been created in azure when the web app was created. This thread discusses how to get the username and password for the depolyment. http://stackoverflow.com/questions/28708471/web-publish-password-not-the-same-as-my-azure-admin-password – Luke Rice Dec 06 '16 at 22:39
  • Thanks. I just deleted all the .user files - Mine seemed to have some kind of logging of when it deployed files? Not needed any way. Gone :D – Piotr Kula Jul 27 '17 at 13:30