Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net 忽略sqlprojAssemblyReference.cache_.net_Git_Gitignore - Fatal编程技术网

.net 忽略sqlprojAssemblyReference.cache

.net 忽略sqlprojAssemblyReference.cache,.net,git,gitignore,.net,Git,Gitignore,我的.net解决方案中有一个数据库项目。每当我构建/重建解决方案时,都会在数据库项目的obj/Debug文件夹中生成“.sqlprojAssemblyReference.cache”文件 我在git中忽略了obj目录和缓存文件,但它仍然没有按预期工作 # Build results [Dd]ebug/ [Oo]bj/ # Visual Studio cache files # files ending in .cache can be ignored

我的.net解决方案中有一个数据库项目。每当我构建/重建解决方案时,都会在数据库项目的obj/Debug文件夹中生成“.sqlprojAssemblyReference.cache”文件

我在git中忽略了obj目录和缓存文件,但它仍然没有按预期工作

    # Build results
    [Dd]ebug/
    [Oo]bj/

    # Visual Studio cache files
    # files ending in .cache can be ignored
    *.[Cc]ache
    # but keep track of directories ending in .cache
    !?*.[Cc]ache/

我希望这个文件不会出现在我的更改中,因为我在.gitignore中添加了这个文件,就像我在.gitignore前面添加了格式的packages文件夹一样。在这两种情况下,我都没有进行任何提交。

这是预期的行为-构建过程将生成此文件

.gitignore
文件只告诉Git/visualstudio此文件/目录不能添加到源代码管理中

如果您已将此文件置于源代码管理中-例如,在添加
.gitignore
文件之前已签入该文件-则可能需要使用以下方法从git中强制删除该文件:

git rm -r --cached path\to\obj

或者请参见

是的,我知道它将作为其预期行为生成,但请您告诉我为什么在将其添加到gitignore后,它会显示为我的更改。在gitignore中添加了另一个文件后,该文件也不再出现在我的更改中。但我没有做出任何承诺。