.vs folder to source control in visual studio 2015? [duplicate]
Asked Answered
A

3

33

What's the best practice for excluding/including the .vs folder for a VS 2015 solution in source control?

After an initial build/edit I only see a .suo file created so far at '[Root]/.vs/[SolutionName]/v14/.suo', so I'm assuming that's the replacement for the old '[SolutionName].suo' and should be excluded (generally) - but will other settings/etc be placed there in some scenarios that I might want to version?

From this uservoice, I'm guessing the answer is that it should be ignored, just wanted a confirm before I updated all my machine settings since I didn't see it in any local docs.

Apiarist answered 20/7, 2015 at 21:46 Comment(1)
We excluded and no issues thus far. Will update if I there's an caveats.Apiarist
C
38

You should not check .vs into source control.

It just contains temporary caches used by Roslyn.

Custodial answered 20/7, 2015 at 21:51 Comment(8)
Agreed, seems like it. Have a reference so we can be sure by chance? Appreciate it sir!Apiarist
Do you have any proof of that? I didn't check in that folder and now another developer's IDE is crashing because it can't find or edit a file from there.Noonberg
What error? Can you attach a debugger and check the exception?Custodial
The .gitignore file automatically produced by the git support in Visual Studio 2015 has the entry: # Visual Studio 2015 cache/options directory .vs/ So Microsoft ignores it.Crumpler
@AndersZommarin: That actually comes from GitHub. github.com/github/gitignore/blob/master/…Custodial
@SLaks: Does indeed look as Microsoft uses that file as the master for their .gitignore file. The one produced by VS2015 is slightly an old version. Good to know if updates are needed!Crumpler
We had a problem where 1 developer had things (Web) configured for his D:\ drive, and another developer had no D:\ drive. When the .vs\config\applicationhost.config file was then checked in, the developer without the D:\ drive couldn't even open the related projects. This thanks to having the ".vs" folder in source control after moving the solution from 1 tfs to another. We went in to TFS source control explorer and deleted it. Then when developers got latest we had them keep their local copy of applicationhost.config. The developer with the problems found a prior copy in prior changeset.Petrochemical
Anyway to prevent VS 2017 from creating this folder for simple C / C++ projects?Fanjet
C
4

You should not check .vs into source control.

It just contains temporary caches used by Roslyn.

Yes, I agreed with SLaks - you can add .vs folder to ignore list - in fact you should do this on the beginning.

.vs contains more then only 'Roslyn cache' - but all stuff stored in this folder is 'working' or 'temporary'... It's means that is not required for storing solution/project - you can delete it when VS is shutdown and after that VS will recreated it when launching the solution - of course you lose your working configuration of the IDE, but no worries, it's not painful.

When you working with ASP.NET - you can find configuration of IISExpress inside .vs folder - and sometimes deleting this file can be very useful - like I said it will be recreated with 'fresh' settings when you lunch VS next time...

Carbonic answered 5/4, 2016 at 1:11 Comment(0)
A
0

You can use .tfignore file rules for excluding some folders and files. It's practice very similar to .gitignore when you use Git, but for Team Foundation Version Control. Just create your file with your custom rules and start to use it.

Abydos answered 20/7, 2015 at 21:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.