IIS 7中的负载测试与线程.NET 3.5 SP1

时间:2009-07-24 22:51:52

标签: asp.net multithreading .net-3.5 thread-safety

我正在使用.Net 3.5 SP1运行IIS 7

任何人都可以告诉我这是否是线程安全的,因为它在高负载的用户下继续失败:

 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

                        }
                    }

}

如果它是线程安全的那么为什么它会失败...?

顺便说一句,我得到的例外是:object reference not set

0 个答案:

没有答案