Last post Sep 04, 2008 05:47 AM by Benson Yu - MSFT
Aug 29, 2008 04:02 PM|webbertc|LINK
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?
Aug 29, 2008 05:12 PM|cv_vikram|LINK
Friend, try this
Hope it helped you. Good luck!
Aug 29, 2008 05:44 PM|webbertc|LINK
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
inheritInChildApplications="false"> around system.web in the parent web.config and that did not work.
Aug 29, 2008 06:08 PM|Bruce L|LINK
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?
Aug 29, 2008 06:25 PM|webbertc|LINK
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
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.
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].
Aug 29, 2008 09:15 PM|webbertc|LINK
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:
<add assembly="System.Core, Version=126.96.36.199, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=188.8.131.52, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.DataSetExtensions, Version=184.108.40.206, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml.Linq, Version=220.127.116.11, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add assembly="System.Transactions, Version=22.214.171.124, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Design, Version=126.96.36.199, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
However, when I take out either one of these, I get an error on the using statement that looks for LINQ.
Sep 04, 2008 05:47 AM|Benson Yu - MSFT|LINK
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.