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=\"Web\" /optionInfer+" />
</compilers>
</system.codedom>
</configuration>
If I set the MetadataRedirectPath=“metadata” , It works Fine, Is there anything wrong?