ASP.Net不会启动 - IIS错误,因为它不在root中?

时间:2013-05-09 20:59:18

标签: asp.net iis iis-7.5

我有一个ASP.Net解决方案,我已经检查过SVN。我已将其保存在c:\inetpub\solution-name\下。我尝试启动的文件位于c:\inetpub\solution-name\trunk\project-name\Default.aspx。当我通过浏览器http://localhost/solution-name/trunk/project-name/访问它时,我收到以下错误:

Server Error in '/' Application.

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 253:      </controls>
Line 254:    </pages>
Line 255:    <roleManager enabled="true" cacheRolesInCookie="true" defaultProvider="AspNetSqlRoleProvider">
Line 256:      <providers>
Line 257:        <clear/>

我认为问题可能与文件的目录结构有关。我不想改变结构,因为我需要能够在inetpub等下拥有多个解决方案。

是否有IIS配置来修复此问题?

1 个答案:

答案 0 :(得分:0)

您需要为IIS中的每个Asp.Net项目创建虚拟目录。此外,如果您使用的是IIS7 +,则可以右键单击文件夹并单击“转换为应用程序”。要创建虚拟目录,可以右键单击IIS中的网站,然后选择“添加虚拟目录”。