Question

I have developed ASP.net application using VS-2010, C#.Net 4.0 with SharpSvn dll. When I'm working with dev server(don't have 3-Tier Architecture), it works fine. But when we are working with QA environment(have 3-Tier Architecture) it gives thread abort exception most of the time.Following shows the code and error log I have. Any help on this really appreciate.

public bool Checkout(string svnurl, string target)
    {
       try
        {
            using (_client = new SharpSvn.SvnClient())
            {
                _client.LoadConfiguration(Path.Combine(Path.GetTempPath(), "Svn"), true);
                _client.Authentication.DefaultCredentials = new TNetworkCredential(_username, _password);
                _client.Authentication.SslServerTrustHandlers += SvnSslOveride;
                var targetsvn = new SvnUriTarget(svnurl);

                if (_client.CheckOut(targetsvn, target))
                {
                    Log.Info("Successfully checked out to following location : " );
                    Log.Info(target);
                    return true;
                }
            }
            Log.Info("Unable to checkout "+ svnurl +" Svn location to target location : ");
           Log.Info(target);
            return false;
        }
        catch (Exception ee)
        {
            Log.Error("Error:SvnClient checkout....");
            Log.Error(ee);
            throw ee;
            return false;
        }
    }

private static void SvnSslOveride(object sender, SvnSslServerTrustEventArgs e)
        {
            e.AcceptedFailures = e.Failures;
            e.Save = true;
        }

error log

ERROR 2013-08-12 12:13:37,714 3223821ms SvnClient Checkout - Error:SvnClient checkout.... ERROR 2013-08-12 12:13:37,730 3223837ms SvnClient Checkout - System.Threading.ThreadAbortException: Thread was being aborted. at svn_client_checkout3(Int32* , SByte* , SByte* , svn_opt_revision_t* , svn_opt_revision_t* , svn_depth_t , Int32 , Int32 , svn_client_ctx_t* , apr_pool_t* ) at SharpSvn.SvnClient.CheckOut(SvnUriTarget url, String path, SvnCheckOutArgs args, SvnUpdateResult& result) at SharpSvn.SvnClient.CheckOut(SvnUriTarget url, String path)

Was it helpful?

Solution

I missed <httpRuntime executionTimeout="(time in seconds)"> tag in web config and it automatically set by IIS server. The default is 110 seconds. Note :In the .NET Framework 1.0 and 1.1, the default is 90 seconds. After I added following line to web.config and it works fine.

<httpRuntime executionTimeout="600">

Previously it works sometimes because the time taken to SVN checkout in DEV server is less than in other environment because of the size of the repositories and network connections. Thanks all for your answers

OTHER TIPS

As per my comment above, I've seen this issue. It appears to be related to plink authentication.

I resolved it by upgrading to the latest build of SharpSVN v1.7, at which point the error changed from a null-ref exception in the C++, to an SVN exception with the message "Can't create tunnel: The parameter is incorrect".

There are a few articles which explain how to resolve this, the best of which I've found here:

SVN+SSH and Sourceforge

In my case, changing the backslashes to forwardslashes in the SVN_SSH env var resolved the problem. Worth giving a shot.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top