Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/313.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用授权的Mercurial.Net pullCommand_C#_Mercurial - Fatal编程技术网

C# 使用授权的Mercurial.Net pullCommand

C# 使用授权的Mercurial.Net pullCommand,c#,mercurial,C#,Mercurial,我正在尝试使用Mercurial.NET库从Mercurial中提取代码更改。我得到一个授权异常,没有得到任何结果,下面是代码 Repository repository = new Repository(@"D:\sandeep\work\20Dec2016"); PullCommand pullcommand = new PullCommand(); repository.Pull(pullcommand); 这是我的代码,有没有办法,我可以为身份验证指定我的凭据(用户名和密码),以便提

我正在尝试使用Mercurial.NET库从Mercurial中提取代码更改。我得到一个授权异常,没有得到任何结果,下面是代码

Repository repository = new Repository(@"D:\sandeep\work\20Dec2016");

PullCommand pullcommand = new PullCommand();
repository.Pull(pullcommand);

这是我的代码,有没有办法,我可以为身份验证指定我的凭据(用户名和密码),以便提取最近的更改?

我可以通过以下代码和Lasse V.Karlsen的帮助获得结果

Repository repository = new Repository(@"D:\sandeep\Work\20Dec2016");
pullCommand.WithConfigurationOverride("auth", "x.prefix", "*");
pullCommand.WithConfigurationOverride("auth", "x.username", "ssk");
pullCommand.WithConfigurationOverride("auth", "x.password", "ssk");
repository.Pull(pullCommand);