diff --git a/NLog.Web.AspNetCore/LayoutRenderers/AspNetRequestValueLayoutRenderer.cs b/NLog.Web.AspNetCore/LayoutRenderers/AspNetRequestValueLayoutRenderer.cs index 2b3b8eae..95a1187e 100644 --- a/NLog.Web.AspNetCore/LayoutRenderers/AspNetRequestValueLayoutRenderer.cs +++ b/NLog.Web.AspNetCore/LayoutRenderers/AspNetRequestValueLayoutRenderer.cs @@ -57,12 +57,18 @@ public class AspNetRequestValueLayoutRenderer : AspNetLayoutRendererBase /// public string Cookie { get; set; } +#if !NETSTANDARD_1plus + + //missing in .NET Core (RC2) + /// /// Gets or sets the ServerVariables item to be rendered. /// /// public string ServerVariable { get; set; } +#endif + /// /// Gets or sets the Headers item to be rendered. /// @@ -109,15 +115,14 @@ protected override void DoAppend(StringBuilder builder, LogEventInfo logEvent) #endif } +#if !NETSTANDARD_1plus else if (this.ServerVariable != null) { -#if !NETSTANDARD_1plus + builder.Append(httpRequest.ServerVariables[this.ServerVariable]); -#else - throw new NotSupportedException(); -#endif } +#endif else if (this.Header != null) { string header = httpRequest.Headers[this.Header];