matt.griffith - thinking out loud

 Wednesday, November 27, 2002

Problem using HttpWebResponse with ThreadPool

I'd had similar trouble in the past trying to tune MaxIoThreads and MaxWorkerThreads. I had an ASP.NET application that was calling out to 2 or 3 Web Services, and when the system was under significant load, it would crap out - It was actually unable to get a free thread (from the system's thread pool I assume) to even get out of the box. I was getting errors in the Socket Class, in the bowels of WebRequest. [Scott Hanselman's Weblog]

It sounds like you were running into the problem using HttpWebResponse from a thread pool thread described here.

8:23:30 AM    

Testing .NET Web Applications

I just found Jim Klopfenstein's Executing ASMX files without a web server article. Jim's code could simplify most Web Service unit testing. And since it doesn't need IIS, or even ASP.NET, it would be easy to run during automated builds. Jim doesn't say, but I wouldn't be surprised if this is the reason he was trying to get this working.

I haven't thought much about it but you should be able to do the same thing for ASPX files. Has someone already done this?

Other random thoughts:

  • Combine a port of HttpUnit with an ASPX runner to unit test Web Forms.
  • Use Xml Diff with Jim's ASMX file runner to unit test Web Services.
  • If you host ASP.NET in your own process you should be able to test HttpModules and HttpHandlers.

[ I originally pulled this post when I noticed I had a lot more to learn about the topic. But I'm reposting it since Scott Hanselman posted about it. Needless to say, I haven't thought through any of this nearly as much as I want to. ]

7:23:32 AM