Compilation Error with Generic Handler in Visual Studio 2008

Posted Monday, July 27, 2009 5:04 PM by CoreyRoth

Anyone else out there notice that if you add an generic handler to your project that it won’t compile?  It appears to be an issue with the template included in Visual Studio and it may have been resolved in a service pack but currently I don’t think so.  The file type I am describing is the .ashx generic handler and not the ASP.NET Handler as you can see below.

GenericHandler

After it creates the file you might immediately notice there are issues.  If you go to compile it, you’ll get errors like seen below.

GenericHandlerError

Luckily, resolving the error is quite easy.  You just need to add System.Web.Services to your using block.  Once you do that, you can compile successfully and begin building your handler.  I just thought I would point this out since I have seen this on multiple systems now.

Comments

# Twitted by coreyroth

Monday, July 27, 2009 6:00 PM by Twitted by coreyroth

Pingback from  Twitted by coreyroth

Leave a Comment

(required)
(required)
(optional)
(required)