I also found the solution. It took me some time to find it, but finally it was simple. In IIS manger for the site Windows Authentication was enabled, Standard(Basic) Authentication was disabled. After enabling Standard, and disabling Windows Authentication in IIS Manager all was working fine.
When the error showed up, the content of the log file was not very descriptive.
w3wp.exe Error: 0 : Error occured and caught in Global.asax - System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at Bonobo.Git.Server.GitAuthorizeAttribute.OnAuthorization(AuthorizationContext filterContext)
at System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>cDisplayClass25.b1e(AsyncCallback asyncCallback, Object asyncState)
...
...
Maybe someone could change the code to improve the log file. It is enough to change method OnAutorization in GitAuthorizeAttribute. Here is what I suggest:
...
string auth = filterContext.HttpContext.Request.Headers"Authorization";
if (!String.IsNullOrEmpty(auth))
{
if (!auth.StartsWith("Basic ")) // added
{
Trace.TraceError("No basis authentication in IIS, authentication toke is: {0}",auth); // added
}
...
With this change people running into this problem may find the solution easier.