【发布时间】:2015-08-30 20:35:26
【问题描述】:
我在使用 Octokit.net 创建新存储库时遇到问题。
这是我的代码:
public async Task stvoriNovi(FormCollection collection)
{
string name = collection.Get("name");
NewRepository newRepo = new NewRepository(name);
newRepo.AutoInit = true;
var accessToken = Session["OAuthToken"] as string;
if (accessToken != null)
{
client.Credentials = new Credentials(accessToken);
}
await client.Repository.Create(newRepo);
}
我已经设置了断点,我发现一切正常。 http://prntscr.com/7h62iq 可以在这里看到。当我让程序运行用于创建新存储库的代码时,这是我的结果:http://prntscr.com/7h63fz 我得到 ctokit.NotFoundException: Not Found。我已经尝试了一切,每次发生错误。我做错了什么?
【问题讨论】:
-
我的直觉是OAuth令牌没有
public_repo或repo的权限 -
你是对的。我忘了把解决方案放在这里。
标签: git repository octokit.net