I have a problem with creating new repository with Octokit.net.
This is my code:
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);
}
I've put breakpoints and there I see that everything is OK. http://prntscr.com/7h62iq which can be seen here. And when I let the program run the code for creating a new repository, this is my result: http://prntscr.com/7h63fz I get ctokit.NotFoundException: Not Found. I have tried everything and each time error occurs. What am I doing wrong?
I think there is an inner error in the line 60 at await client.Respository.Create(newRepo); Try this to create a client with basicAuth, a repository with a MIT licence. And with the try catch, see the error.Message if any.
If the repository already exists, you can remove the old one. Warning, this code definitely remove the repository without confirmation.