Symptoms
When using VS.NET Web Developer Express Edition, you may have a site that compiles fine in the development environment but fails when you copy it to the local IIS server.
Cause
ASP.NET 2.0 is not the default .NET version used by IIS. It works in the development environment because VS.NET compiles a virtual web server with the proper .NET version before code compilation begins.
Thinking it occurred because the virtual directory wasn't identified as an application, I created a site (called personal) that mapped to the directory I copied, but still failed.
As it turns out, 'xmlns' is a component in ASP.NET 2.0, and will generate that error when compiled on an IIS server running ASP.NET 1.1. This is delightfully easy to fix:
- Open Internet Information Services and navigate to "Default Web Site" (or the site you're using as your default).
- Right click the Site icon (the one with the globe).
- Select the ASP.NET tab. You'll see a drop-down with the available versions (if you're getting the error, odds are, you'll see 1.1).
- Select the proper build of ASP.NET 2.0.
- Restart IIS.
Your page should now work.