Getting a .NET 2.0+AJAX working on Win2008+IIS7

Discussion in 'Windows / IIS' started by staranise, Mar 13, 2009.

  1. Hi,

    I'm on DASP with Win2008+IIS7 hosting. I'm trying to get a .NET 2.0+AJAX site working but am getting an error regarding the assembly "System.Web.Extensions, Version=1.0.61025.0 ...". I have this assembly referenced in my web.config. I believe it is for AJAX. I've read in another post that v1.xxxxx of this assembly is not supported in IIS7. If so, anyone know the correct config I need for my web.config to work on DASP?

    Thanks in advance! ..sa

    -- Error page posted below

    Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


    Stack Trace:

    [FileNotFoundException: Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
    System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +0
    System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +64
    System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +58
    System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +65
    System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +342
    System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +52

    [ConfigurationErrorsException: Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
    System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +351
    System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +56
    System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +146
    System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1219
    System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +97
    System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +188
    System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +295
    System.Web.HttpApplicationFactory.GetPipelineApplicationInstance(IntPtr appContext, HttpContext context) +56
    System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +231

    [HttpException (0x80004005): Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8890735
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +333


    Version Information: Microsoft .NET Framework Version:2.0.50727.3074; ASP.NET Version:2.0.50727.3074
     
  2. Hi,
    Are you using Visual Studio? If so, did you let it create the updated web.config sections?
    You should have a section like this:

    <!--
    The system.webServer section is required for running ASP.NET AJAX under Internet
    Information Services 7.0. It is not necessary for previous version of IIS.
    -->
    <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
    <remove name="ScriptModule"/>
    <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </modules>
    <handlers>
    <remove name="WebServiceHandlerFactory-Integrated"/>
    <remove name="ScriptHandlerFactory"/>
    <remove name="ScriptHandlerFactoryAppServices"/>
    <remove name="ScriptResource"/>
    <add name="Reserved-ReportViewerWebControl-axd" path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler" resourceType="Unspecified" preCondition="integratedMode" />
    <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </handlers>
    <directoryBrowse enabled="false" />
    <httpProtocol>
    <customHeaders>
    <clear />
    <add name="X-UA-Compatible" value="IE=EmulateIE7" />
    </customHeaders>
    </httpProtocol>
    </system.webServer>
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    staranise,

    Only AJAX 3.5 is installed on windows 2k8 server. Have you considered upgrading your application to use AJAX 3.5?
     
  4. Thanks for the replies.

    My project is from VWD 2005 and designed to run on IIS 6/.NET 2.0. I'm planning on migrating it to IIS7/.NET 3.5 but before doing so, I would like to first get it running on IIS7/.NET 2.0.

    I've been doing a lot of research on migrating .NET 2.0 to 3.5 and IIS 6 to 7. I'm guessing that the problem I've described is due to incorrect web.config entries (particularly for AJAX). If anyone has any other suggestions that might work, please let me know. Otherwise, I think I have no other choice but to migrate to 3.5 immediately!

    Thanks again. ..sa
     
  5. Hi,
    If you want I can create a basic Ajax page for IIS7 with the default web.config, ZIP it up and you can see it running on a DASP server then D/L it.
    Salute,
    Mark
     
  6. Thx, mark. It's okay; I've started my migration to 3.5 and used the web.config that VWD 2008 had converted for me. I'm no longer getting the assembly reference error. Instead, I'm dealing with other migration nightmares!

    Thanks all. ..sa
     
  7. Good job ;-)
     
  8. mjp

    mjp

    That can be painful, for sure, but you'll be glad you did it in the long run.
     

Share This Page