代码改变世界

配置IIS使用ASP.NET 2.0

2007-03-03 13:41  Colin Han  阅读(6802)  评论(4编辑  收藏  举报

一般情况下,安装VS 2005时,安装程序会自动配置本地IIS服务使用ASP.NET 2.0。我们可以直接在VS 2005下编写或调试WEB应用程序。

但是,如果我们先安装了VS2005,然后才安装的IIS。这时,IIS会设置为使用ASP.NET 1.0。我们在VS2005中建立WEB程序是会出现下面的提示:

The site 'http://localhost/xxxxxx' has not been configured for use with ASP.NET 2.0. Microsoft Visual Studio has been designed for use with ASP.NET 2.0; if not configured some features may make incorrect assumptions, and pages designed with the tool may not render correctly.

并且不能自动配置成功。

这时,只需要在Visual Studio 2005 Command Prompt中执行下面的命令

aspnet_regiis -i -enable