Upgrade to 4.5.6 get Error

my website is based on mvc5, works fine in servicestack 4.5.4, after I upgrade to 4.5.6, my NLog will Get two error message:
First:

============================================ 
2017-02-02 19:02:50.9698 【ERROR】【ServiceStackHost】 ServiceStack.ServiceStackHost.OnLogError ServiceBase::Service Exception 未将对象引用设置到对象的实例。 System.NullReferenceException NullReferenceException System.NullReferenceException: 未将对象引用设置到对象的实例。
在 ServiceStack.Platforms.PlatformNet.ExtractHandlerPathFromWebServerConfigurationXml(String rawXml) System.String ExtractHandlerPathFromWebServerConfigurationXml(System.String) 在 ServiceStack.Platforms.PlatformNet.ExtractHandlerPathFromWebServerConfigurationXml(String rawXml) 
============================================ 

Second:

============================================ 
2017-02-02 19:15:14.1063 【ERROR】【ServiceStackHost】 ServiceStack.ServiceStackHost.LogInitComplete Initializing Application DEMO took 654.0374ms. 1 error(s) detected: [{"ErrorCode":"NullReferenceException","Message":"未将对象引用设置到对象的实例。","Errors":[]}] 
============================================ 

My web.config is

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings />
  <system.diagnostics>
    <switches>
      <add name="XPO" value="3" />
    </switches>
  </system.diagnostics> 
  <appSettings>
    <add key="vs:EnableBrowserLink" value="false" />
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />  
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />  
  </appSettings>
  <location path="ssapi">
    <system.web>
      <httpHandlers>
        <add path="*" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" />
      </httpHandlers>
    </system.web>
    <system.webServer>
      <validation validateIntegratedModeConfiguration="false" />
      <modules runAllManagedModulesForAllRequests="true">
        <remove name="WebDAVModule" />
      </modules>
      <urlCompression doStaticCompression="true" doDynamicCompression="true" />
      <handlers>
        <add path="*" name="ServiceStack.Factory" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
      </handlers>
    </system.webServer>
  </location>
  <system.web>
    <trace enabled="true" />
    <globalization culture="zh-CN" uiCulture="zh-CN" />
    <authentication mode="None" />
    <compilation debug="true" targetFramework="4.6.2" enablePrefetchOptimization="true" />
    <httpRuntime targetFramework="4.6.2" />
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="FormsAuthentication" />
      <remove name="UrlRoutingModule" />
    </modules>
    <staticContent>
      <remove fileExtension=".woff" />
      <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
      <remove fileExtension=".woff2" />
      <mimeMap fileExtension=".woff2" mimeType="application/x-font-woff" />
    </staticContent>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
      </dependentAssembly>
      ...
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.data>
    <DbProviderFactories>
      <remove invariant="MySql.Data.MySqlClient" />
      <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
      <remove invariant="Oracle.ManagedDataAccess.Client" />
      <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </DbProviderFactories>
  </system.data>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>
</configuration>

If I set the MetadataRedirectPath=“metadata” , It works Fine, Is there anything wrong?

Is your site working after upgrade or does not work? In v4.5.6 was added additional logging when exception occurs during parsing web.config in this commit but it should not affect on the functionality of the site, it’s just message that the <handlers> could not be found under <system.webServer> tag. I tried to run empty ASP.NET ServiceStack application with your config and it works.

my site is work. In the above web.config, It has two < system.webServer > tag, the second one didn’t have have < handlers > under < system.webServer > tag . Is there anyway can not occur the exception?

In the web.config, If I Comment the second <system.webServer> , It will not get the exception, Is additional logging when exception occurs during parsing web.config has Bug?

  <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="FormsAuthentication" />
      <remove name="UrlRoutingModule" />
    </modules>
    <staticContent>
      <remove fileExtension=".woff" />
      <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
      <remove fileExtension=".woff2" />
      <mimeMap fileExtension=".woff2" mimeType="application/x-font-woff" />
    </staticContent>
  </system.webServer>

In the previous version (4.5.4) the was the same exception, but it was not logged. In version 4.5.6 all exceptions during parsing <handlers> section are logged. I made this commit which should fix the exception raising in the case where <handlers> are not defined in the main <system.webServer> section.