Problems with WebServices after upgrade from .Net 3.5 to 4.0?
<p>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.</p>
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"
type="System.Web.Script.Services.ScriptHandlerFactory" />
to the <handlers>-section in Web.config.