在IIS 7.5中部署asp.net网站

时间:2012-07-18 11:11:04

标签: asp.net windows-7 iis-7.5

在11s 7.5中部署网站时出现此错误:

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: 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.

Source Error: 


Line 16:     <compilation debug="true" targetFramework="4.0" />
Line 17: 
Line 18:     <authentication mode="Forms">
Line 19:       <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
Line 20:     </authentication>

源文件:C:\ Users * \ Documents \ Visual Studio 2010 \ Projects \ web \ web \ web.config行:18

我正在尝试在本地部署我的网站进行测试。

1 个答案:

答案 0 :(得分:0)

请查看以下解决方案:

  1. 删除bin和obj文件夹,运行Clean Solution并再次构建它,错误消失。

  2. 检查运行该站点的应用程序池,以确保应用程序池使用的是.NET 4.0 Framework(而不是.NET 2.0 Framework)。