libgit2 / libgit2/libgit2sharp

Natives libraries are not disposed

Open
#1,837 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Description

I'm using libGitSharp under IIS pool, when IIS pool is off I can compile my VS solution without any problems, but it I want to recompile the web site when the pool process is up, I always get an error with git2-106a5f2.dll assembly that is loaded and never disposed. All my libgitsharp code is around a USING statement.

Reproduction steps

Create a web project, code something with libgitsharp, run it, try to recompile the project

Expected behavior

I should be able to recompile my project without errors

Actual behavior

I get following error :
3>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4943,5): warning MSB3061: Unable to delete file "....\bin\lib\win32\x64\git2-106a5f2.dll". Access to the path '...\bin\lib\win32\x64\git2-106a5f2.dll' is denied.

Version of LibGit2Sharp (release number or SHA1)

LibGitSharp 0.26.2

Operating system(s) tested; .NET runtime tested

Windows 10 2004, .NET 4.6.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the web-project reproduction under IIS on Windows 10 and the libGitSharp code inside the reported USING statement. Investigate how the loaded git2-106a5f2.dll is retained after the web site runs, then verify the fix by recompiling while the IIS pool remains active and confirming the DLL can be deleted.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.