代码之家  ›  专栏  ›  技术社区  ›  mare

在web.config location元素中无法识别InheritInChildApplications属性

  •  27
  • mare  · 技术社区  · 15 年前

    我试过把衣服包起来

    <system.web>
    

    具有

    <location path="." InheritInChildApplications="false">
    

    这样地

    <location path="." InheritInChildApplications="false">
    <system.web>...</system.web>
    </location>
    

    但是VS2010网站开发者快车一直在说

    运行web应用时出现错误:

    HTTP错误500.19-内部服务器错误

    配置错误无法识别的属性“InheritInChildApplications”。

    我的配置:ASP.NET 4.0 RTM、VS 2010、IIS 7.5

    4 回复  |  直到 4 年前
        1
  •  9
  •   kim3er    15 年前

    它不应该是小写的“i”吗?

    <location path="." inheritInChildApplications="false">
    

    祝你好运,

        2
  •  62
  •   Sprintstar    14 年前

    可能是因为没有在根节点上指定命名空间?如

    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    

    <configuration>
    
        3
  •  16
  •   GavinR    14 年前

    inheritInChildApplications 不是.net 4.0中位置节点的有效属性。

    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    

    .NET4.0提供了一种处理配置继承的不同方法。

    http://msdn.microsoft.com/en-us/library/b6x6shw7.aspx http://msdn.microsoft.com/en-us/library/ms178692.aspx 更多细节。

        4
  •  1
  •   Sparkle    12 年前

    我经常使用clear来实现这一点:

    <configuration>
       <system.web>
      <assemblies>
         <clear>
      <clientTarget>
         <clear>
      <compilation>
         <compilers>
            <clear>
      <httpHandlers>
         <clear>
      <httpModules>
         <clear>
      <serviceDescriptionFormatExtensionTypes>
         <clear>
      <webServices>
         <protocols>
            <clear>
      <soapExtensionTypes>
         <clear>
      <soapExtensionReflectorTypes>
         <clear>
      <soapExtensionImporterTypes>
         <clear>