views:

26

answers:

0

i am running iis 7 with .net 3.5 sp1

Can anyone tell me if this is thread safe since it keeps on failing under high load of users

 private static void addQueryStringParameters(XElement inputs)
        {
NameValueCollection qs = HttpContext.Current.Request.QueryString;
XElement queryStringParameters = new XElement("QueryStringParameters");


                    foreach (string key in qs.AllKeys)
                    {
                        try
                        {
                            if (!String.IsNullOrEmpty(key))
                               -- some code   qs[Key]
                        }
                        catch (Exception exception)
                        {
                               -- some code

                        }
                    }

}

if it is thread safe then y else would it fail..

by the way exception that i get is object reference not set