简体   繁体   English

对于.Net项目,我应该从源代码管理中排除哪些文件扩展名?

[英]For a .Net project, what file extensions should I exclude from source control?

Everytime I start a project I have to think carefully about which files to exclude from source control. 每次我开始一个项目时,我都要仔细考虑从源代码管理中排除哪些文件。 Has someone made a list of the criteria so I can look it up from the beginning? 是否有人列出了标准清单,以便从头开始查找? I work on my own so I have not got round to it. 我自己工作所以我没有完成它。 I appreciate that in the case of a DLL, you would want to include some and exclude others, so it is not just dependent on the file extension. 我很欣赏在DLL的情况下,你想要包含一些并排除其他的,所以它不仅仅依赖于文件扩展名。 My projects are ASP.Net, although a general discussion of other templates would also be useful. 我的项目是ASP.Net,虽然对其他模板的一般性讨论也很有用。

From http://blog.goneopen.com/2009/06/git-excludes-for-dotnet/ : 来自http://blog.goneopen.com/2009/06/git-excludes-for-dotnet/

.DS_Store
._*
TestResults
*Resharper*
**.ReSharper**
**\_ReSharper.**
*.bak
*.cache
*.resharperoptions
*.suo
*.user
*.vsprops
*/TestResults
*\bin*
*\obj*
_ReSharper.*

If you use ReSharper , be sure to exclude _Resharper* folders 如果您使用ReSharper ,请务必排除_Resharper*文件夹

If you're using Subversion for source control then the VisualSVN Visual Studio plug-in will manage excludes for you automatically. 如果您使用Subversion进行源代码管理,那么VisualSVN Visual Studio插件将自动为您管理排除。

Be sure to include any third-party dlls that your project references that won't be in the GAC of your build or deployment machines. 确保包含项目引用的任何第三方dll,这些dll不在构建或部署机器的GAC中。 Our practice is to have a lib folder that all such dlls live in, and we add references to them from that folder. 我们的做法是有一个所有这些dll都存在的lib文件夹,我们从该文件夹中添加对它们的引用。 This ensures that the hintpath property in the csproj file is correct (it stores a relative path to the referenced dll). 这可以确保csproj文件中的hintpath属性正确(它存储引用的dll的相对路径)。

Do not sourcecontrol bin and obj folders, as well as *.suo and *.user (if you're using Visual Studio) files. 不要使用*.suo binobj文件夹,以及*.suo*.user (如果您使用的是Visual Studio)文件。

If you feel uneasy about keeping third-party DLLs in source control, try Componento , which, granted, does not yet have a sizable components database. 如果您对在源代码管理中保留第三方DLL感到不安,请尝试使用Componento ,它已被授予,但尚未拥有相当大的组件数据库。

作为一般规则,只有构建应用程序所需的源控制文件。

Generic ingores from a project folder: 项目文件夹中的通用ingores:

*.Cache
*.user
bin
obj

And from the solution (a level up) 从解决方案(升级)

*.cache
_PublishedWebSites
*.suo

We've also got the following - which are instance specific config settings referenced out of generic configs (ie web.config for asp.net apps) 我们还得到以下内容 - 这是通用配置引用的实例特定配置设置(即asp.net应用程序的web.config)

AppSettings.config
Provider.config
connections.config

There are .config.sample files that are version controlled. 但是也有一些版本控制.config.sample文件。

You should probably set bin, obj, *.cache, *.user and *.suo as global in your subversion setup - but as this is (if memory serves) machine specific you're probably going to end up doing explicit ignores anyway 你可能应该在你的subversion设置中将bin,obj,* .cache,* .user和* .suo设置为全局 - 但是因为这是(如果内存服务)机器特定的,你可能最终会以明确的方式忽略

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应该从源代码管理中排除哪些.net文件? - What .net files should be excluded from source control? 我应该如何在源代码管理中处理项目中的秘密值? - How should I handle secret values in a project in source control? 什么是.NET平台文件扩展名? - What Are the .NET Platform File Extensions? .NET项目-版本控制中应包含.dll和.pdb文件吗? - .NET project--should .dll and .pdb file be included in version control? 从.NET Source Project而不是从目标读取配置文件 - Reading configuration file from .NET Source Project, not from target 当我从源文件编译应用程序时,默认的目标.NET Framework版本是什么? - What is the default targeted .NET Framework version when i compile an application from Source File? 下载文件时,我应该从.NET控制器返回到AngularJS什么? - What should I return from my .NET controller to AngularJS when downloading a file? 如何在.NET项目中从.Net Core项目添加源文件? - How can we add a source file from .Net Core project in a .NET project? 如何从 .NET Core/Standard 项目中排除文件/文件夹? - How do I exclude files/folders from a .NET Core/Standard project? 源代码控制从Accurev迁移到Git(.net) - Source Control Migration from Accurev to Git (.net)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM