Problems with WebServices after upgrade from .Net 3.5 to 4.0?
When upgrading a project from .Net 3.5 to 4.0, it seems the ScriptHandlerFactory entry is removed from the <handlers> section in Web.config. Here's how to solve this problem.
I have several WebServices which I call from JS with JSON format. This worked perfectly fine when I was running in local Visual Studio web server (Cassini), but with IIS 7.5 on the test server, I got this error:
System.InvalidOperationException: Request format is invalid: application/json; charset=utf-8
The solution is to add:
<add name="ScriptHandlerFactory" verb="*" path="*.asmx"
to the <handlers>-section in Web.config.