Friday, June 3, 2011

The content type text/html; charset=utf-8 of the response message does not match

When you face a following issue once you hosted a WCF service in IIS

“The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were”

This reason might be you have to set up WAS (Windows Process Activation Service). The WAS is the generalization of IIS features that work with non-HTTP transfer protocol like by WCF, such as TCP, named pipes, and Message Queue . Basically WCF uses the listener adapter interface to communicate activation requests that are received over the non-HTTP protocols supported by WCF, such as TCP, named pipes, and Message Queue.

To install the WCF non-HTTP activation components
1. Click the Start button, and then click Control Panel.
2. Click Programs, and then click Programs and Features.
3. On the Tasks menu, click Turn Windows features on or off.
4. Find the .NET Framework 3.0 node, select and then expand it.
















5. Select the WCF Non-Http Activation Components box and click on Next.




Please refer this MSDN artical for more details

Tuesday, May 10, 2011

strange issue in ASP.NET Ajax client side scripting: ASP.NET Ajax client-side framework failed to load

We have faced some strange issue in ASP.NET Ajax client side scripting
The issue details as follows

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Tue, 26 Apr 2011 16:18:50 UTC

Message: Invalid character
Line: 1
Char: 1
Code: 0
URI: http://../../ScriptResource.axd?d=JzKN4uR5DgyYaoDORVzMmepU_GKfpwb9ej55-ParCkDVx3npCy73EGC9BE3OxRu-U7yLMB48wpUN2aTLq-tor0k80o1WRlXwc5IGkAxjhe43b2S5p3ADjyTK2Mds85luE3N01A2&t=11e6618b


Message: ASP.NET Ajax client-side framework failed to load.
Line: 49
Char: 34
Code: 0
URI: http://



The beauty of this issue is the website is working properly in some browser without any issue. Even we have tried by IE 8 in one system it was working fine and in the same version of IE8 in the another system it was not working fine. It was bit frustrating us to solve this issue.

There are many posts and suggestion against this issue, unfortunately nothing solved our issue. At last we found one post which helped to solve our issue.
We have fixed this issue by adding following simple line in the Web.Config file

<system.web.extensions>
<scripting>
<scriptResourceHandler enableCompression="false"
enableCaching="true"/>
</scripting>
</system.web.extensions>


The actual problem was in some of the systems IE is not able to decompress the scripts in the client side. This might be they have turned off the “Use HTTP 1.1” option in the advanced setting of IE. If it is turned off the system is behind the proxy server .

Monday, May 9, 2011

Unable to start debugging. The Silverlight debugging component

Recently I have faced a following issue in Visual Studio 2010 while executing the Silverlight controls.

Unable to start debugging. The Silverlight debugging component ‘..\dbgshim.dll' was not installed correctly. Re-install the Silverlight Developer Runtime.

The blow URL helped me to resolve this issue:

http://blogs.msdn.com/b/alikl/archive/2010/07/14/resolve-unable-to-start-debugging-the-silverlight-developer-runtime-not-installed-please-install-a-matching-version-visual-studio-2010-silverlight-4.aspx