If your web servers host a complex IIS tree, beware of nested ASP.NET applications and their respective web.config's. If a "parent" ASP.NET application declares a type (and therefore a dependency on an assembly), the "child" application inherits this declaration. See the following msdn article for lengthy discussion.
What this means, ultimately, is that your child application will be looking for a dll in its /bin folder. When it doesn't find it, the child application throws a yellow screen.
Here is an example. I've set up http://localhost/MyApp, a do-nothing app that happens to implement the ASP.NET 1.1 URL Mapping Module discussed in a previous blog. I've built another do-nothing app, and for demonstration purposes created a virtual directory hosting this app under the do-nothing parent, http://localhost/MyApp/MySubApp.
See what happens when I try to run the child app from a browser...
Solutions
To resolve the error above, you can take one of the following approaches:
- Copy the assembly to the child's /bin folder. This works, but it's sloppy configuration. Why xcopy dll's across your file system, introducing redundancy and superfluousness?
- GAC the assembly. That way it's available to the child, and any other application, whether or not it's needed.
- Restructure IIS to avoid the problem.