Thursday, March 22, 2012

ASP.NET - Method 'get_EnableCdn' in type 'System.Web.UI.ScriptManager' from assembly 'System.Web.Extensions' does not have an implementation

Issue:
Error: "Method 'get_EnableCdn' in type 'System.Web.UI.ScriptManager' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation."

Reason:
This error is frequent in ASP.NET projects which are migrated from an older version of .NET Framework to a new version of Framework. So mostly in projected build in Visual Studio 2005/2008 when build in Visual Studio 2010, this error might occur. This is because of the web application referring to an older version of "System.Web.Extensions" Assembly.

Solution:
You will have to explicitly reference to the latest version of the "System.Web.Extensions" Assembly. You can do it in web.config of your website/web application as below.

  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
      <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
      <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
    </dependentAssembly>
  </assemblyBinding>

1 comment:

  1. Hi,Websites whose pages are narrower in width and take up less bandwidth work much better for mobile devices.One problem for Web Design Cochin is that standard websites are difficult to view and take a long time to download on some of these devices with their small screeans and wireless connections. Thanks....

    ReplyDelete