I have a .NET site in IIS 6 on Windows 2003 with a child virtual application. Site structure looks like this:
- MyWebSite (Points to d:\MyWebSite\Versions\1.2)
- Templates (Virtual Application, points to d:\MyWebSite\Common\Templates)
- bin
It’s working fine. Now I’m trying to upgrade from .NET 3.5 to 4.0. When pages from the virtual application are run I get an exception on an httpmodule in the web.config:
Exception type: ConfigurationErrorsException Exception message: Could
not load file or assembly ‘MyWebSite.dll, Version=1.0.0.0,
Culture=neutral’ or one of its dependencies. The system cannot find
the file specified.
The MyWebSite.dll is in the bin folder of my website. The assembly binder log entry has this report:
LOG: Appbase = file:///D:/MyWebSite/Common/Templates/
LOG: Initial PrivatePath = D:\MyWebSite\Common\Templates\bin
So it’s looking for the bin folder inside the virtual application directory rather than the root site folder. It didn’t seem to work this way with .NET 3.5. What has changed, and how can I make the Templates virtual application locate the correct bin folder? I would rather not provide probing information for each .dll in the bin folder. Thanks for any help.
Ok, I think I’ve figured out the issue. I missed a couple of key things in my question. The errors were for requests on extensionless paths, which should have returned 404 errors instead of of being processed. It seems that .NET 4 includes a feature for extensionless urls in IIS 6 that is enabled by default. It adds “/eurl.axd/GUID” to the url through an ISAPI filter so that it will be processed by aspnet_isapi.dll. I had to add a registry DWORD HKLM\SOFTWARE\Wow6432Node\Microsoft\ASP.NET\4.0.30319.0\EnableExtensionlessUrls (or HKLM\SOFTWARE\Microsoft\ASP.NET\4.0.30319.0\EnableExtensionlessUrls for non-Wow64) and set it to 0. You can read more about it here: http://blogs.msdn.com/b/tmarq/archive/2010/06/18/how-to-disable-the-asp-net-v4-0-extensionless-url-feature-on-iis-6-0.aspx