There was a bug with both with the Beta version of VS 2005 and also the Website Administration Tool which caused the above schema attribute to be added to the root “Configuration” tag of the web.config. You can go through the first three References at the bottom of this article for a more detailed description of the problem.
Until now I was under the impression, that this bug only affected VS 2005 Intellisense while editing the web.config. However, recently I encountered another more serious issue which occurred at runtime due to this additional schema tag being present in the web.config. It so happens, that with this tag being present, the “codeBase” hint specified in the web.config does not take any effect on the assembly probing mechanism of the runtime to resolve an assembly reference.
The codeBase hint is typically configured as follows to specify a path for the runtime to probe for referenced files:-
In the above example, for the 22.214.171.124 version of the assembly, the codeBase specified the 1.0 folder within the bin folder and for the 126.96.36.199, it specifies the 1.1 folder. That is to say, once the runtime determines the correct assembly version required, it checks if that assembly version has been bound before, checks the global assembly cache successively and if it does not find a match in either, then it looks at the location specified by the codeBase hint.
However, with the additional namespace tag specified in the root “Configuration” tag, the runtime completely ignored the codeBase hint and did not look for the assembly in the specified path even though it could not find the required version of the assembly in the previously bound paths or the GAC. As a result, one of the following two errors would result:-
- Could not load file or assembly ‘Assembly1, Version=188.8.131.52, Culture=neutral, PublicKeyToken=76cd4ba45e0a88a1’ or one of its dependencies. System could not find the file.
- Could not load file or assembly ‘Utility, Version=184.108.40.206, Culture=neutral, PublicKeyToken=764d581291d764f7′ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference.
The solution is pretty simple. Just remove the namespace tag from the root “Configuration” tag.