Could not load ... 'System.Web.Extensions' error

Last post 09-04-2008 1:47 AM by Benson Yu - MSFT. 6 replies.

Sort Posts:

  • Could not load ... 'System.Web.Extensions' error

    08-29-2008, 12:02 PM
    • Member
      3 point Member
    • webbertc
    • Member since 07-30-2008, 10:16 PM
    • Posts 9

    I have a web.config file in a parent directory that applies to files in that directory.  Then I have another web.config in a directory within the parent directory for it's files.  It was running okay until our last release and now the aspx files in the subdirectory give me a "Could not load the 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." error.  The web.config in the parent directory has a reference to System.Web.Extensions in <sectiongroup> and <assemblies>, but the other web.config does not.  If I copy those pieces from the other web.config into this one, I get "Section or group name 'system.web.extensions' is already defined. Updates to this may only occur at the configuration level where it is defined."  What can I do to fix this?

  • Re: Could not load ... 'System.Web.Extensions' error

    08-29-2008, 1:12 PM
    • Star
      8,512 point Star
    • cv_vikram
    • Member since 07-04-2006, 1:33 PM
    • Earth
    • Posts 1,056

    Friend, try this

    http://forums.asp.net/t/1135367.aspx

    Hope it helped you. Good luck!

    Please Don't forget to click "Mark as Answer" on the post that helped you.
    This can be beneficial to other community members reading the thread.
  • Re: Could not load ... 'System.Web.Extensions' error

    08-29-2008, 1:44 PM
    • Member
      3 point Member
    • webbertc
    • Member since 07-30-2008, 10:16 PM
    • Posts 9

    Thanks, I looked at the link, but mine is a different problem.  The parent site is using the System.Web.Extensions piece and works fine.  The child site does not use the System.Web.Extensions piece.  It seems to me to be an inheritance issue, so I tried using <remove> in the assemblies section of the child web.config.  The error went away when I used it on my development server, but when I do it on my production server, I still get the error.  I also tried using <location path="." inheritInChildApplications="false"> around system.web in the parent web.config and that did not work.

    Any ideas?

  • Re: Could not load ... 'System.Web.Extensions' error

    08-29-2008, 2:08 PM
    • All-Star
      16,090 point All-Star
    • Bruce L
    • Member since 02-08-2007, 1:53 PM
    • Posts 2,548

    using remove to unload the assembly is definitely the right way to do this.  If it works on  your dev server but not your production server, the change is working.  Are you sure you copied the new web.config over? 

  • Re: Could not load ... 'System.Web.Extensions' error

    08-29-2008, 2:25 PM
    • Member
      3 point Member
    • webbertc
    • Member since 07-30-2008, 10:16 PM
    • Posts 9

    Just checked it again - I'm positive the code is in there.  Don't know if it will help, but here's the error text:

    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].
    

  • Re: Could not load ... 'System.Web.Extensions' error

    08-29-2008, 5:15 PM
    • Member
      3 point Member
    • webbertc
    • Member since 07-30-2008, 10:16 PM
    • Posts 9

    I have another clue that may help solve this puzzle.  I remembered that with this release we are now using LINQ in the parent directory.  I noticed that the parent web.config has 2 versions of the system.web.extensions assembly.  Here's the assembly portion of the file:

    <assemblies>
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
        <add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
     </assemblies>

    However, when I take out either one of these, I get an error on the using statement that looks for LINQ.

    Help, anyone????

  • Re: Could not load ... 'System.Web.Extensions' error

    09-04-2008, 1:47 AM
    Answer

    Hi webbertc,

    The “'System.Web.Extensions” is the Strong Named assembly that should be installed in GAC, the file not found issue should not caused by the relative path problem of the sub directory. In my opinion, the problem is the AJAX 1.0 extension is not installed on the server.

    To solve this issue, we can remove the “1.0.61025.0” version “System.Web.Extensions” assembly from the “assemblies” section. As you said, after doing that, the LINQ assembly not found issue appears. For this issue, I would recommend checking if .NET Framework 3.5 installed on the Server.

    Sincerely,
    Benson Yu
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
Page 1 of 1 (7 items)