Which files in a Visual C# Studio project don'

2019-01-07 08:49发布

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 acceptable to me to add the project files to the repository, since this repo is just for the two of us using Visual C# Studio. But it feels like there are some irrelevant files in there. Can someone familiar with Visual C# Studio project files tell me which files can safely be svn:ignored?

Some suspect files:

  • project.csproj
  • project.csproj.Debug.cachefile
  • project.csproj.user
  • project.sln
  • project.suo
  • Content\Content.contentproj

I'm sure the .sln is required, but what's this .suo? and the .csproj? Can/should any of these be generated by Visual C# Studio on loading a project?

11条回答
再贱就再见
2楼-- · 2019-01-07 09:13

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.

查看更多
Bombasti
3楼-- · 2019-01-07 09:14

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.

查看更多
Juvenile、少年°
4楼-- · 2019-01-07 09:14

Needed...

*.sln - The solution file contains references to all the projects and dependencies between the projects.
*.csproj - The project files themselves. These tell what files are included in the project, references, and the build steps for the project.

Not...

*.suo - This is a user settings file...

查看更多
Luminary・发光体
5楼-- · 2019-01-07 09:16

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.

查看更多
小情绪 Triste *
6楼-- · 2019-01-07 09:21

I leave out the Visual Studio Solution User Options file (*.suo) and the binaries directories as they get recompiled everytime you build your solution (the bin and obj folders).

查看更多
登录 后发表回答