Hmmm… this is bugging the shit out of me: I have an ASP.NET 2.0 project that’s complaining that it’s not a proper virtual directory in IIS. The problem is that it doesn’t like the virtual level configuration settings in web.config so I get an error for the Authentication section which is not allowed on a non-virtual:

Error 1 
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS. D:\projects2005\Articles\HowAspNetWorks\Backup\HowAspNetWorks\Web.config 45 

Problem is, the app is configured as a virtual and runs fine. If there really was a problem the app would not run due to the web.config problem. But it runs fine both with the built-in Web Server and with IIS.

Ok, take another look at the message above: Notice the Backup directory? That gives it away, right? Guess what though: The file name doesn’t display if you view it in Visual Studio. Only the Copy actually gave me the filename. So I found this as was posting about the problem right now!

So why this error? When I pushed this project into ASP.NET 2.0 I had VS migrate it and update and create a backup copy (usually I don’t do that but I musta slipped <g>). So VS created this backup copy and it basically breaks the compile of the project. Maybe a Backup directory is not the right place to put a backup project.

It’s interesting though. This is a directory based Web Project and Visual Studio somehow manages to figure out that the backup directory is not a virtual and therefore doesn’t allow the keys like Authentication in the web.config. So apparently VS accesses the IIS Metabase to match up the directory with a virtual.

Not sure if I think this is a good idea – this can get confusing as it is in this case when something isn’t configured right in IIS. But if you’re testing with the internal Web Server none of that would matter, but you still get the IIS related errors.

I hate it when tools try to be to damn helpful – I don’t need a baby sitter <g>…

Now playing: Rage Against the Machine - Maggie's Farm