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.
本文详细解释了使用VS.NET Web Developer Express Edition开发网站时遇到的编译问题,即网站在开发环境中编译正常,但在本地IIS服务器上失败的情况。问题根源在于ASP.NET 2.0不是IIS默认使用的.NET版本。通过在Internet Information Services中设置正确的ASP.NET版本,解决了此问题。
839

被折叠的 条评论
为什么被折叠?



