Which files in a Visual C# Studio project don't need to be versioned?

前端 未结 11 1082

I\'m new to Visual C# Studio (actually using the Express edition, but another developer is using the full version), and we are using version control (svn).

It\'s acc

相关标签:
11条回答
  • 2020-11-30 01:28

    We also work with Visual Studio C# and SVN and I don't know about all the project files, but we only exclude the complete bin directory.

    0 讨论(0)
  • 2020-11-30 01:29

    As this as not been indicated in other answers yet :

    In the case you are using Visual Studio with Unity 3D, you can safely add both *.csproj and *.sln to the .gitignore file, on the contrary of the usual case.

    Indeed, the project structure is managed by Unity itself, not by Visual Studio. The only consequences of keeping them in source control are conflicts, even more so if for some reasons different Visual Studio versions are being used among commiters.

    Example .gitignore for Unity 3D : https://github.com/github/gitignore/blob/master/Unity.gitignore

    0 讨论(0)
  • 2020-11-30 01:34

    The .sln file defines your solution together with the .proj files (one for each project), so keep them in your svn!

    You can skip the .suo file (personal settings - binary anyway) as well as the bin or obj folders. Also the .cache files can be left.

    0 讨论(0)
  • 2020-11-30 01:35

    Dont include
    bin
    obj
    *.suo
    *.user
    _Resharper* (if you have Resharper)

    Include
    *.sln
    *.csproj

    You can also check the .gitignore file for visual studio projects on github.

    0 讨论(0)
  • 2020-11-30 01:35

    You definitely need csproj files... You might want to try AnkhSVN or VisualSVN, those VS addins add only the required files to SVN.

    Or you could remove files from your directory structure until it does not load anymore.

    I suggest experimenting this way because it is a great way to learn how a solution is structures by VS.

    0 讨论(0)
  • 2020-11-30 01:36

    Shouldn't be versioned:

    • .csproj.user is the user's project file settings (e.g. startup project)
    • .suo is the user's solution file settings

    Should be versioned:

    • .sln is the solution file itself (what projects it contains etc)
    • .csproj is the project file

    I'm not sure about "contentproj" but it sounds like it's a project file which should be under svn.

    0 讨论(0)
提交回复
热议问题