Go to content

Go to employees

Go to search

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.

Anders Murel
 

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.


Comments:

  1. You might also have a look at this: http://geekswithblogs.net/lorint/archive/2007/03/28/110161.aspx
Post a comment