From be3a321e90e69596e4e6524c7f7cce8685927a9f Mon Sep 17 00:00:00 2001
From: Julian Verdurmen <304NotModified@users.noreply.github.com>
Date: Sat, 2 Apr 2016 02:34:46 +0200
Subject: [PATCH] ServerVariable in ASP.NET 5 -> removal from API for DNX ->
config exception
---
.../AspNetRequestValueLayoutRenderer.cs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/NLog.Web.ASPNET5/LayoutRenderers/AspNetRequestValueLayoutRenderer.cs b/NLog.Web.ASPNET5/LayoutRenderers/AspNetRequestValueLayoutRenderer.cs
index 302edff3..d2248499 100644
--- a/NLog.Web.ASPNET5/LayoutRenderers/AspNetRequestValueLayoutRenderer.cs
+++ b/NLog.Web.ASPNET5/LayoutRenderers/AspNetRequestValueLayoutRenderer.cs
@@ -57,11 +57,14 @@ public class AspNetRequestValueLayoutRenderer : AspNetLayoutRendererBase
///
public string Cookie { get; set; }
+#if !DNX
+ //missing in DNX (at least for ASP.NET 5 RC1)
///
/// 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 +112,12 @@ protected override void DoAppend(StringBuilder builder, LogEventInfo logEvent)
#endif
}
+#if !DNX
else if (this.ServerVariable != null)
{
-#if !DNX
builder.Append(httpRequest.ServerVariables[this.ServerVariable]);
-#else
-
- throw new NotSupportedException();
-#endif
}
+#endif
else if (this.Header != null)
{
string header = httpRequest.Headers[this.Header];