libgit2 引发了一个错误.类别 = Os(错误) [英] An error was raised by libgit2. Category = Os (Error)

查看:23
本文介绍了libgit2 引发了一个错误.类别 = Os(错误)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经遇到过好几次了:

I have run into this several times now:

 An error was raised by libgit2. Category = Os (Error). 

在我编写代码时有时会导致此或类似错误:

Which sometimes causes this or similar error while i am writing code:

Failed to open '.../App_Data/....mdf': 
The process cannot access the file because it is being used by another process.

发生这种情况时,如果不重新启动 Visaul Studio 2012,我将无法编码.

When this happens i can't code without restarting my Visaul Studio 2012.

我认为这是由 Source Control - Git 引起的,因为我不记得在我为 Visual Studio 和 Team Foundation 安装 Git 扩展之前遇到过这个问题.

I think it's being caused by Source Control - Git as i don't remember having this problem before i installed the Git extension for Visual Studio and Team Foundation.

有没有其他人遇到过这个问题,他们是如何解决的?

Has anyone else run into this and how did they solve it?

推荐答案

我今天刚刚在一个新的 Visual Studio 项目中遇到了这个问题.该项目使用自动生成的 .gitignore ,其中包含以下条目,我认为应该可以很好地覆盖 .mdf 文件:

I just ran into this today with a new Visual Studio project. The project was using the autogenerated .gitignore which had the following entries which I thought should have covered the .mdf file just fine:

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf

但是我还是收到了:

An error was raised by libgit2. Category = Os (Error). 
Failed to open '.../App_Data/....mdf': 
The process cannot access the file because it is being used by another process.

所以我编辑了 .gitignore,在每个条目前面加上一个星号斜线,就像这样:

So I edited the .gitignore, preceding each entry with an asterisk-slash, like so:

# SQL Server files
*/App_Data/*.mdf
*/App_Data/*.ldf

而且我还能照常营业.

这篇关于libgit2 引发了一个错误.类别 = Os(错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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