Visual Studio为什么在Azure DevOps签入中排除BIN和OBJ文件夹 [英] Why does visual studio exclude BIN and OBJ folders at Azure DevOps checkin

查看:140
本文介绍了Visual Studio为什么在Azure DevOps签入中排除BIN和OBJ文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道从Visual Studio或已在Visual Studio中编码的Git-Bash在Azure DevOps上检入代码的通用方法是什么.发生的问题是bin文件夹中包含许多第三方dll,这些第三方dll在构建项目之前保留在源代码中.这些第三方dll是必需的.但是,在签入Azure DevOps之后,bin和obj不存在.这是由于.gitignore和.gitattribute文件导致的.到目前为止,我已经删除了这两个文件并检查了bin文件夹.这两个文件的目的是什么.有人可以提出解决方法的建议.

I want to know what is the generic way to check-in code on Azure DevOps from Visual Studio or Git-Bash that has been coded in Visual Studio. The problem that occurs is the bin folder contains many third party dll's which are kept in the source before building the project. Those third party dll's are necessary to project. However after check-in to Azure DevOps the bin and obj are not present. This happens due to .gitignore and .gitattribute files. I have deleted both the files and checked in the bin folder as of now. What is the purpose of these two files. Can someone please suggest a way to resolve.

推荐答案

.gitignore 文件指定未跟踪的文件. .gitattributes 定义每个路径的属性.它们是Git的配置文件.

.gitignore file specifies the untracked files. .gitattributes defines attributes per path. They are configuration files of Git.

在Visual Studio中,bin和obj文件夹用于存储编译器生成的输出(请参见

In Visual Studio, the bin and obj folders are used to store the output generated by compilers (see here). As these output files are generated by compilers, you don't want to track them in the source control.

如果您的项目需要引用某些第三方dll,则最好的方法是,如果有dll可用的Nuget软件包,则将它们作为Nuget软件包进行引用.如果没有,您可以将它们放在bin或obj以外的其他文件夹中,以便可以在Git中对其进行跟踪.您不应更改.gitignore来跟踪bin或obj文件夹.

If your project need to reference to some 3rd party dlls, the best approach is to reference to them as Nuget packages if there are Nuget packages available for the dlls. If not, you can put them in a folder other than bin or obj so they can be tracked in Git. You should not change .gitignore to track bin or obj folders.

这篇关于Visual Studio为什么在Azure DevOps签入中排除BIN和OBJ文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆