In previous versions, ASP.NET considered the web.config file to be untouchable. What you, the developer, wrote into the file may as well have been engraved like the Ten Commandments into stone tablets. But under the new compilation model, ASP.NET wants to collaborate with you in authoring the web.config file. Specifically, during site compilation, it will insert lines into the /configuration/system.web/compilation/assemblies element to make sure that the runtime JIT compiler knows how to link to the dependencies of project references. In other words, it will enumerate the entire dependency tree and write the necessary metadata to make sure that the JIT compiler knows what it needs, if you have not already provided the information via an explicit reference.
Sep 29, 2016 - You have setup Outlook® Integration and find you receive the following error message when opening or working in Outlook: 'Error: 'Could not.
We stumbled onto this behavior quite by accident. For no obvious reason, when we ran our build script to compile/deploy a new website, the Visual Studio 2005 compiler decided to sneak these lines into the web.config:
<addassembly='stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A'/>
<addassembly='Office, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A'/>
<addassembly='System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A'/>
<addassembly='Office, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A'/>
<addassembly='System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A'/>
And VS 2005 was quite insistent about adding these lines: it actually removed the read-only attribute from web.config, inserted the lines, and continued on its merry way. We, of course, knew nothing about the compiler's silent literary ambitions, so the site deployed as usual. But then it blew up; we did not have the stdole and Office assemblies version 7.0.3300.0 installed on the web farm, so things went south very quickly. The event log recorded something like this:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Parser Error Message: Could not load file or assembly 'stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Googling turned up a thread where a developer declared that the problem could be solved by changing the default html editor on the build machine. This did not work for us. Then I noticed that one of my colleagues had recently added a new reference in one of the projects that was in the site project reference list. In other words, after my colleague's modification, we could now draw a line indirectly from the site to the stdole and Office assemblies: (1) site references a project, (2) the project references the Dart.PowerWEB.LiveControls component, and (3) Dart.PowerWEB.LiveControls references the stdole and Office assemblies.
We had not noticed this prior to deployment because the Dart development suite had installed the assemblies on the test sites' host server. Of course, the Dart run-time environment on the production server farm did NOT install the assemblies. Shame on you, Dart! After we removed the Dart.PowerWEB.LiveControls reference from the project, ASP.NET lost its literary ambitions. And not a moment too soon; next thing you know, the compiler will start a blog. And I don't want to have to compete with Microsoft technology!
So if you notice the new literary ambitions of the ASP.NET compiler, and they suddenly mess with your deployment, you know what to do: examine any references you recently added to the site's dependency tree, because one of them is the source of your problem. Keep removing references until ASP.NET ends its crazy literary ambitions. There are enough authors and bloggers in the world already; we don't need ASP.NET to join the crowd.
Posted on Friday, April 28, 2006 8:39 PM .NET Gotchas | Back to top