libgit2引发了一个错误.Category = Os(错误)

Kom*_*gem 7 git version-control libgit2 visual-studio-2012 azure-devops

我现在已经碰到过几次了:

 An error was raised by libgit2. Category = Os (Error). 
Run Code Online (Sandbox Code Playgroud)

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

Failed to open '.../App_Data/....mdf': 
The process cannot access the file because it is being used by another process.
Run Code Online (Sandbox Code Playgroud)

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

我认为这是由于Source Control - Git我在安装Visual Studio和Team Foundation的Git扩展之前不记得遇到此问题.

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

Dou*_*low 8

我今天遇到了一个新的Visual Studio项目.该项目使用自动生成.gitignore,其中包含以下条目,我认为应该已经覆盖了.mdf文件:

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf
Run Code Online (Sandbox Code Playgroud)

不过我仍然收到:

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.
Run Code Online (Sandbox Code Playgroud)

所以我在.gitignore每个条目的前面编辑了一个星号斜杠,如下所示:

# SQL Server files
*/App_Data/*.mdf
*/App_Data/*.ldf
Run Code Online (Sandbox Code Playgroud)

我能像往常一样继续营业.