【问题标题】:IIS 7.5 virtual directory runtime errorIIS 7.5 虚拟目录运行时错误
【发布时间】:2012-06-16 08:10:41
【问题描述】:

我有 IIS 7.5 和一个网站

我添加了新的虚拟目录并获得了Runtime Error

http://ngg-l.com/admin

我尝试将此 Web 应用程序添加为新网站,一切正常,但它在虚拟目录中不起作用

有什么建议吗?

事件查看器警告:

Exception information: 
    Exception type: ConfigurationErrorsException 
    Exception 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. (C:\inetpub\wwwroot\Admin\web.config line 49)
   at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
   at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
   at System.Web.Configuration.RuntimeConfig.GetSectionObject(String sectionName)
   at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index)
   at System.Web.Configuration.RuntimeConfig.get_Identity()
   at System.Web.HttpContext.SetImpersonationEnabled()
   at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)



Request information: 
    Request URL: http://ngg-l.com/admin 
    Request path: /admin 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: IIS APPPOOL\NGG 

Thread information: 
    Thread ID: 13 
    Thread account name: IIS APPPOOL\NGG 
    Is impersonating: False 
    Stack trace:    at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
   at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
   at System.Web.Configuration.RuntimeConfig.GetSectionObject(String sectionName)
   at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index)
   at System.Web.Configuration.RuntimeConfig.get_Identity()
   at System.Web.HttpContext.SetImpersonationEnabled()
   at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)

【问题讨论】:

  • 请检查设置中的应用程序池......
  • 查看事件查看器的应用程序部分,以查看确切的错误。或者在你的 web.config 中设置 这样我们就可以看到实际的错误。
  • 请看我更新的问题

标签: c# iis-7 asp.net-mvc-4 virtual-directory


【解决方案1】:

正如错误消息所示,您需要将已添加的虚拟目录转换为应用程序。在 IIS 中右键单击它,您应该会看到执行此操作的选项。

【讨论】:

    猜你喜欢
    • 2011-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-05
    • 1970-01-01
    相关资源
    最近更新 更多