2013-05-22 133 views
3

我一直在试图从我的电脑访问我的合作伙伴的Web应用程序,但这个问题一直显示up.I试图将Web应用程序转换为IIS中的应用程序,但问题仍然存在。如何解决'/'应用程序中的服务器错误。

配置错误 描述:处理服务此请求所需的配置文件时发生错误。请查看下面的具体错误细节并适当修改您的配置文件。

解析器错误消息:在应用程序级别之外使用注册为allowDefinition ='MachineToApplication'的节是错误的。此错误可能是由于虚拟目录未被配置为IIS中的应用程序。

源错误:

Line 17:    <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
Line 18:    <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation> 
Line 19:  <authentication mode="Forms"> 
Line 20:   <forms loginUrl="~/Account/Login.aspx" timeout="2880"/> 
Line 21:  </authentication> 

源文件:C:\的Inetpub \ wwwroot的\ FAS \ FAS \ web.config行:19

显示其他配置错误:

这是一个在应用程序级别之外使用注册为allowDefinition ='MachineToApplication'部分的错误。此错误可能是由于虚拟目录未被配置为IIS中的应用程序。 (C:\ inetpub \ wwwroot \ fas \ fas \ web.config第22行) 在应用程序级别之外使用注册为allowDefinition ='MachineToApplication'的节是错误的。此错误可能是由于虚拟目录未被配置为IIS中的应用程序。 (C:\ inetpub \ wwwroot \ fas \ fas \ web.config第28行) 在应用程序级别之外使用注册为allowDefinition ='MachineToApplication'的节是错误的。此错误可能是由于虚拟目录未被配置为IIS中的应用程序。 (C:\ inetpub \ wwwroot \ fas \ fas \ web.config第34行)

+0

您需要指定更多信息。请阅读常见问题。 http://stackoverflow.com/faq – Marko

+0

描述中的错误确实含糊不清。错误可能是在服务器上运行的应用程序的代码中... –

+0

我已经添加了服务器给出的响应。请留意模糊信息 –

回答

4

发生的问题,因为你必须在应用程序的一个子目录另一个web.config文件,并它有authentication元素。 authentication元素只能出现在根web.config中。请参阅元素文档here。根据元素信息部分它说,配置位置的Machine.config,根级别的Web.config,应用程序级别的Web.config

为了解决这个问题,你必须做之一:

  • 删除子web.config,并只留下一个根。
  • 或者,如果子web.config对于您的应用程序是必不可少的,请从中删除整个authentication元素。您可以在根级web.config中只配置一次authentication一次。
1

您的web.config文件不正确。

你有这样的事情:

<configuration> 
    <system.web> 
     <compilation> 
      <assemblies> 
       <add assembly="System.Design, ..."/> 
       <!-- many more --> 
       <add assembly="System.Design, ..."/> 
     <authentication mode="Forms"> 
      <forms loginUrl="~/Account/Login.aspx" timeout="2880"/> 
     </authentication> 

你需要一些关闭标签:

  <assemblies> 
       <add assembly="System.Design, ..."/> 
       <!-- many more --> 
       <add assembly="System.Design, ..."/> 
      </assemblies> <!-- You need this --> 
     </compilation> <!-- and this --> 
     <authentication mode="Forms"> 
      <forms loginUrl="~/Account/Login.aspx" timeout="2880"/> 
     </authentication> 
+0

我只接收了一部分代码。此处显示的代码是导致错误的部分 –

+0

请发布所有相关代码。这将包括张贴有效的XML。 –

0

对我来说,这是Owin

FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 
RouteConfig.RegisterRoutes(RouteTable.Routes); 
BundleConfig.RegisterBundles(BundleTable.Bundles); 

的不正确的配置必须移动到哪里Startup.Configuration此配置后Owin Autofac配置情况。

相关问题