Just started "playing" with LibGit2Sharp and I already have an issue accessing the list of branches from my local repository. The goal is to access Git (for now just to get the list of branches) from my webservice.
[WebMethod]
public string GetStringOfBranches()
{
string gitPath = @"C:\Users\MyUser\Documents\MyRepository";
using (var repo = new Repository(gitPath))
{
//Console.WriteLine("start");
foreach (var branch in repo.Branches)
{
Console.WriteLine(branch.FriendlyName);
}
}
}
If I run the project in debug mode or from my test project, it works fine. If I publish it to IIS ... the game is over, I get the error "LibGit2Sharp.RepositoryNotFoundException: Path 'C:\Users\MyUser\Documents\MyRepository' doesn't point at a valid Git repository or workdir. at LibGit2Sharp.Core.Proxy.git_repository_open(String path) at LibGit2Sharp.Repository..ctor(String path, RepositoryOptions options, RepositoryRequiredParameter requiredParameter) at WebSrv3.wsGitInterface.GetStringOfBranches() in C:\Users\MyUser\Documents\Visual Studio 2017\Projects\WebSrv3\WebSrv3\MyWs.asmx.cs:line 58".