.vs\config\applicationhost.config in source control

asp.netVisual Studioasp.net CoreIis Express

asp.net Problem Overview


Visual Studio 2015 adds a file named .vs\config\applicationhost.config to the root of a solution when an ASP.NET Web application project is created.

Should this file be checked in to source control or should it be ignored (so that each user will have their own local copy)?

asp.net Solutions


Solution 1 - asp.net

You should ignore .vs folder all together.

However, there are cases where you want to persist some config on your applicationhost.config file such as registering FQDN as explained here.

For this type of config, you want to use the global application host file where you can persist your changes.

In a classic Web Application project (where you have .csproj file), you need to set the UseGlobalApplicationHostFile property to true inside the .csproj file:

<UseGlobalApplicationHostFile>True</UseGlobalApplicationHostFile>

VS 2015 honors this and uses the global application host file. However, there is no way to tell ASP.NET 5 projects to look for this today as far as I know.

Solution 2 - asp.net

If you need custom configuration for IIS Express (example), add the file to source control so that it is shared with the team. If not, you can exclude this file, and VS2015 will recreate it as needed.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDavid GardinerView Question on Stackoverflow
Solution 1 - asp.nettugberkView Answer on Stackoverflow
Solution 2 - asp.netEdward BreyView Answer on Stackoverflow