因此,我的问题是我有一个相当大的ASP.NET 3.5项目,我正在尝试使用IIS Express安装在本地运行。我是团队中使用IIS Express运行此项目和其他项目的众多开发人员之一,实际上,我每天都在没有问题的情况下每天运行一个.NET 4.0站点(已完成本地SSL)。作为参考,我的计算机运行带有Microsoft Visual Studio 2010的Windows 7 Ultimate 64位,并且我是本地计算机上的管理员。 Visual Studio以管理权限运行,并且我确保inetmgr中列出的所有应用程序池都在运行。

这是尝试在本地运行项目时得到的工作流程:


第一次运行项目时,或者删除Microsoft WebMatrix(IIS Express的配置实用程序,类似于inetmgr)中列出的任何网站时,都会收到以下消息序列:


(1)Microsoft Visual Studio中的是-否对话框,指出:

The local IIS URL http://localhost:2000/site/path/ specified for Web project My.Web.Project has not been configured. In order to open this project the virtual directory needs to be configured. Would you like to create the virtual directory now?

(2)此时,我单击“是”。 VS的中间窗口弹出并显示一个加载栏,大约达到50%,然后VS的警告对话框弹出,内容如下:

Configuring Web http://localhost:2000/ for ASP.NET 3.5 failed. You must manually configure this site for ASP.NET 3.5 in order for the site to run correctly. Visual Studio cannot detect whether this virtual root has been configured for use with ASP.NET 2.0 The likely cause is that you do not have sufficient privileges to access the IIS metabase. You may need to manually configure this site for ASP.NET 2.0 in order for your site to run correctly.

(3)此时,我只能单击“确定”或“帮助”,因此我单击“确定”继续。它将继续对解决方案中配置为在IIS Express中本地运行的任何其他项目执行相同的过程。


当我尝试通过按CTRL-F5在本地运行站点时,出现一个错误对话框,显示Unable to launch the IIS Express Web Server
当我尝试查看有关Microsoft Web Matrix中所述站点的详细信息时,我从WebMatrix收到一条错误消息,内容为:An error caused WebMatrix to shut down. Error message: Invalid application pool name
此错误消息是正确的,除了当我查看IIS Express配置文件(C:\%User Dir%\ My Documents \ IISExpress \ config \ applicationhost.config)时,在<sites>部分中,每个应用程序都有一个标签,仅指定<application>属性,未指定path属性。 (相反,在IISExpress上运行的4.0应用程序指定了此属性)。
applicationPool属性添加到站点后,可以在WebMatrix中打开/查看/编辑其详细信息,但是仍然无法在本地运行它。


那么,在我的机器上我做错了什么或什么配置不正确,使我无法运行,但是没有其他使用相同代码的开发人员吗?

最佳答案

对于应用程序,如果未明确指定appPool,则将使用默认的apppool。在IIS Express中,默认应用程序池为Clr4IntegratedAppPool

<applicationDefaults applicationPool="Clr4IntegratedAppPool" />

如果您的应用程序不是.net 4.0应用程序,则进行相应设置。如果您的应用程序是2.0应用程序,则将appPool设置为“ Clr2IntegratedAppPool”。

下面给出的是IIS Express配置中预定义的应用程序池。

Clr4IntegratedAppPool
Clr4ClassicAppPool
Clr2IntegratedAppPool
Clr2ClassicAppPool

10-05 21:05
查看更多