title: LockedFileException: failed to lock file config.lock for writing
body: <p>I'm trying to run a dotnet build on my Jenkins build server. I keep getting the following error:</p>
  
  <blockquote>
    <p>C:\Nuget\PackagesCache\gitversiontask\5.1.3\build\GitVersionTask.targets(10,9): error : LockedFileException: failed to lock file 'C:/jenkins/workspace/Shared-Build/.git/config.lock' for writing</p>
  </blockquote>
  
  <p>And sometimes this message appear:</p>
  
  <blockquote>
    <p>C:\Nuget\PackagesCache\gitversiontask\5.1.3\build\GitVersionTask.targets(10,9): error : LibGit2SharpException: failed to rename lockfile to 'C:/jenkins/workspace/Shared-Build/.git/config': Access is denied. </p>
  </blockquote>
  
  <p>What interesting is that another team member can successfully run the build, without these errors appearing. </p>
  
  <p>I tried to look online but no clear solution is available. This exception seems to be related to the gitversiontask Nuget package, but I'm using a fairly updated version of it. Did anyone ever encountered this error before?</p>