Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added tests for <extensions /> for .NET, SL and CF

Added SampleExtensions project
Fixed <variable /> handling for all platforms and added unit tests.
  • Loading branch information...
commit 17e016b7a6adaa3d72604b826fab5b6143c0c728 1 parent 0318728
@jkowalski authored
Showing with 1,467 additions and 52 deletions.
  1. +6 −0 src/NLog.netcf20.sln
  2. +6 −0 src/NLog.netcf35.sln
  3. +6 −0 src/NLog.netfx20.sln
  4. +6 −0 src/NLog.netfx35.sln
  5. +6 −0 src/NLog.netfx40.sln
  6. +1 −0  src/NLog.proj
  7. +32 −0 src/NLog.sl2.sln
  8. +6 −0 src/NLog.sl3.vs2008.sln
  9. +6 −0 src/NLog.sl4.sln
  10. +19 −2 src/NLog/Config/XmlLoggingConfiguration.cs
  11. +190 −0 tests/NLog.UnitTests/Config/ExtensionTests.cs
  12. +72 −0 tests/NLog.UnitTests/Config/VariableTests.cs
  13. +8 −1 tests/NLog.UnitTests/NLog.UnitTests.netcf20.csproj
  14. +8 −1 tests/NLog.UnitTests/NLog.UnitTests.netcf35.csproj
  15. +10 −2 tests/NLog.UnitTests/NLog.UnitTests.netfx20.csproj
  16. +10 −2 tests/NLog.UnitTests/NLog.UnitTests.netfx35.csproj
  17. +10 −3 tests/NLog.UnitTests/NLog.UnitTests.netfx40.csproj
  18. +14 −36 tests/NLog.UnitTests/NLog.UnitTests.sl2.csproj
  19. +10 −2 tests/NLog.UnitTests/NLog.UnitTests.sl3.csproj
  20. +10 −2 tests/NLog.UnitTests/NLog.UnitTests.sl4.csproj
  21. +8 −1 tests/NLog.UnitTests/NLogTestBase.cs
  22. +55 −0 tests/SampleExtensions/FooLayout.cs
  23. +49 −0 tests/SampleExtensions/FooLayoutRenderer.cs
  24. +49 −0 tests/SampleExtensions/MyConditionMethods.cs
  25. +47 −0 tests/SampleExtensions/MyTarget.cs
  26. BIN  tests/SampleExtensions/NLogTests.snk
  27. +60 −0 tests/SampleExtensions/ProjectFileInfo.xml
  28. +88 −0 tests/SampleExtensions/SampleExtensions.netcf20.csproj
  29. +85 −0 tests/SampleExtensions/SampleExtensions.netcf35.csproj
  30. +74 −0 tests/SampleExtensions/SampleExtensions.netfx20.csproj
  31. +78 −0 tests/SampleExtensions/SampleExtensions.netfx35.csproj
  32. +74 −0 tests/SampleExtensions/SampleExtensions.netfx40.csproj
  33. +92 −0 tests/SampleExtensions/SampleExtensions.sl2.csproj
  34. +106 −0 tests/SampleExtensions/SampleExtensions.sl3.csproj
  35. +106 −0 tests/SampleExtensions/SampleExtensions.sl4.csproj
  36. +60 −0 tests/SampleExtensions/WhenFooFilter.cs
View
6 src/NLog.netcf20.sln
@@ -10,6 +10,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.netcf20", "NLog\NLog.n
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.UnitTests.netcf20", "..\tests\NLog.UnitTests\NLog.UnitTests.netcf20.csproj", "{C6558721-BA0E-488A-AE61-87D46BEF0E16}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtensions.netcf20", "..\tests\SampleExtensions\SampleExtensions.netcf20.csproj", "{C6558721-BA0E-488A-AE61-87D46BEF1E16}"
+EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = NLog.netcf20.vsmdi
@@ -27,6 +29,10 @@ Global
{C6558721-BA0E-488A-AE61-87D46BEF0E16}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C6558721-BA0E-488A-AE61-87D46BEF0E16}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C6558721-BA0E-488A-AE61-87D46BEF0E16}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C6558721-BA0E-488A-AE61-87D46BEF1E16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C6558721-BA0E-488A-AE61-87D46BEF1E16}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C6558721-BA0E-488A-AE61-87D46BEF1E16}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C6558721-BA0E-488A-AE61-87D46BEF1E16}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
6 src/NLog.netcf35.sln
@@ -10,6 +10,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.netcf35", "NLog\NLog.n
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.UnitTests.netcf35", "..\tests\NLog.UnitTests\NLog.UnitTests.netcf35.csproj", "{2A1AFF0C-0C26-4B2E-95C5-BCFBBE347031}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtensions.netcf35", "..\tests\SampleExtensions\SampleExtensions.netcf35.csproj", "{2A1AFF0C-0C26-4B2E-95C5-BCFBBE343031}"
+EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = NLog.netcf35.vsmdi
@@ -27,6 +29,10 @@ Global
{2A1AFF0C-0C26-4B2E-95C5-BCFBBE347031}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A1AFF0C-0C26-4B2E-95C5-BCFBBE347031}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A1AFF0C-0C26-4B2E-95C5-BCFBBE347031}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2A1AFF0C-0C26-4B2E-95C5-BCFBBE343031}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2A1AFF0C-0C26-4B2E-95C5-BCFBBE343031}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2A1AFF0C-0C26-4B2E-95C5-BCFBBE343031}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2A1AFF0C-0C26-4B2E-95C5-BCFBBE343031}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
6 src/NLog.netfx20.sln
@@ -10,6 +10,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.netfx20", "NLog\NLog.n
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.UnitTests.netfx20", "..\tests\NLog.UnitTests\NLog.UnitTests.netfx20.csproj", "{1653EE05-2720-4A85-BF14-74C4493787B1}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtensions.netfx20", "..\tests\SampleExtensions\SampleExtensions.netfx20.csproj", "{1653EE05-2720-4A85-BF14-74C4593787B1}"
+EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = NLog.netfx20.vsmdi
@@ -27,6 +29,10 @@ Global
{1653EE05-2720-4A85-BF14-74C4493787B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1653EE05-2720-4A85-BF14-74C4493787B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1653EE05-2720-4A85-BF14-74C4493787B1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1653EE05-2720-4A85-BF14-74C4593787B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1653EE05-2720-4A85-BF14-74C4593787B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1653EE05-2720-4A85-BF14-74C4593787B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1653EE05-2720-4A85-BF14-74C4593787B1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
6 src/NLog.netfx35.sln
@@ -16,6 +16,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.Test", "..\tests\NLog.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.BinaryCompatTests.netfx35", "..\tests\NLog.BinaryCompatTests\NLog.BinaryCompatTests.netfx35.csproj", "{157588EF-6665-468C-B860-B90B71A5E7FB}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtensions.netfx35", "..\tests\SampleExtensions\SampleExtensions.netfx35.csproj", "{A8CA32F1-BD4C-4A99-B307-99A93DB64B9F}"
+EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = NLog.netfx35.vsmdi
@@ -45,6 +47,10 @@ Global
{157588EF-6665-468C-B860-B90B71A5E7FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{157588EF-6665-468C-B860-B90B71A5E7FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{157588EF-6665-468C-B860-B90B71A5E7FB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A8CA32F1-BD4C-4A99-B307-99A93DB64B9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A8CA32F1-BD4C-4A99-B307-99A93DB64B9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A8CA32F1-BD4C-4A99-B307-99A93DB64B9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A8CA32F1-BD4C-4A99-B307-99A93DB64B9F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
6 src/NLog.netfx40.sln
@@ -12,6 +12,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.UnitTests.netfx40", ".
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.Extended.netfx40", "NLog\NLog.Extended.netfx40.csproj", "{A961A1F9-1024-4446-BF9E-A923137340B8}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtensions.netfx40", "..\tests\SampleExtensions\SampleExtensions.netfx40.csproj", "{FE067913-E9A8-41F0-89FA-C1136F8FB6A8}"
+EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = NLog.netfx40.vsmdi
@@ -33,6 +35,10 @@ Global
{A961A1F9-1024-4446-BF9E-A923137340B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A961A1F9-1024-4446-BF9E-A923137340B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A961A1F9-1024-4446-BF9E-A923137340B8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FE067913-E9A8-41F0-89FA-C1136F8FB6A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FE067913-E9A8-41F0-89FA-C1136F8FB6A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FE067913-E9A8-41F0-89FA-C1136F8FB6A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FE067913-E9A8-41F0-89FA-C1136F8FB6A8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
1  src/NLog.proj
@@ -360,6 +360,7 @@
<Target Name="SyncProjectItems" DependsOnTargets="BuildSyncProjectItemsTool">
<Exec Command='"$(SyncProjectItems)" ProjectFileInfo.xml' WorkingDirectory="NLog" />
<Exec Command='"$(SyncProjectItems)" ProjectFileInfo.xml' WorkingDirectory="..\Tests\NLog.UnitTests" />
+ <Exec Command='"$(SyncProjectItems)" ProjectFileInfo.xml' WorkingDirectory="..\Tests\SampleExtensions" />
</Target>
<Target Name="BuildApiDumpTool">
View
32 src/NLog.sl2.sln
@@ -0,0 +1,32 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.UnitTests.sl2", "..\tests\NLog.UnitTests\NLog.UnitTests.sl2.csproj", "{D172C49A-55C9-47B3-B1F7-40D5AB64E8E8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.sl2", "NLog\NLog.sl2.csproj", "{0D90976A-D1FD-4FEF-B7A9-9A40731C19EB}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtensions.sl2", "..\tests\SampleExtensions\SampleExtensions.sl2.csproj", "{D172C49A-55C9-47B3-B3F7-40D5AB64E8E8}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {D172C49A-55C9-47B3-B1F7-40D5AB64E8E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D172C49A-55C9-47B3-B1F7-40D5AB64E8E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D172C49A-55C9-47B3-B1F7-40D5AB64E8E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D172C49A-55C9-47B3-B1F7-40D5AB64E8E8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0D90976A-D1FD-4FEF-B7A9-9A40731C19EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0D90976A-D1FD-4FEF-B7A9-9A40731C19EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0D90976A-D1FD-4FEF-B7A9-9A40731C19EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0D90976A-D1FD-4FEF-B7A9-9A40731C19EB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D172C49A-55C9-47B3-B3F7-40D5AB64E8E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D172C49A-55C9-47B3-B3F7-40D5AB64E8E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D172C49A-55C9-47B3-B3F7-40D5AB64E8E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D172C49A-55C9-47B3-B3F7-40D5AB64E8E8}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
View
6 src/NLog.sl3.vs2008.sln
@@ -6,6 +6,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.sl3", "NLog\NLog.sl3.c
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.UnitTests.sl3", "..\tests\NLog.UnitTests\NLog.UnitTests.sl3.csproj", "{C48047FF-7E14-443D-906D-7E021AB5707A}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtensions.sl3", "..\tests\SampleExtensions\SampleExtensions.sl3.csproj", "{C48047FF-7E14-443D-906D-7E021AB5307A}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -24,6 +26,10 @@ Global
{C48047FF-7E14-443D-906D-7E021AB5707A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C48047FF-7E14-443D-906D-7E021AB5707A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C48047FF-7E14-443D-906D-7E021AB5707A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C48047FF-7E14-443D-906D-7E021AB5307A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C48047FF-7E14-443D-906D-7E021AB5307A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C48047FF-7E14-443D-906D-7E021AB5307A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C48047FF-7E14-443D-906D-7E021AB5307A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
6 src/NLog.sl4.sln
@@ -6,6 +6,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.sl4", "NLog\NLog.sl4.c
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.UnitTests.sl4", "..\tests\NLog.UnitTests\NLog.UnitTests.sl4.csproj", "{C48047FF-7E14-443D-906D-7E021AB5707A}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtensions.sl4", "..\tests\SampleExtensions\SampleExtensions.sl4.csproj", "{C480452F-7E14-443D-906D-7E021AB5707A}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -24,6 +26,10 @@ Global
{C48047FF-7E14-443D-906D-7E021AB5707A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C48047FF-7E14-443D-906D-7E021AB5707A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C48047FF-7E14-443D-906D-7E021AB5707A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C480452F-7E14-443D-906D-7E021AB5707A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C480452F-7E14-443D-906D-7E021AB5707A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C480452F-7E14-443D-906D-7E021AB5707A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C480452F-7E14-443D-906D-7E021AB5707A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
21 src/NLog/Config/XmlLoggingConfiguration.cs
@@ -40,6 +40,7 @@ namespace NLog.Config
using System.Globalization;
using System.IO;
using System.Reflection;
+ using System.Windows;
using System.Xml;
using NLog.Common;
using NLog.Filters;
@@ -477,7 +478,10 @@ private void ParseFilters(LoggingRule rule, XmlReader reader)
private void ParseVariableElement(XmlReader reader)
{
- reader.Skip();
+ string name = reader.GetAttribute("name");
+ string value = reader.GetAttribute("value");
+
+ this.variables[name] = value;
}
private string GetCaseInsensitiveAttribute(XmlReader reader, string attributeName, string defaultValue)
@@ -735,10 +739,17 @@ private void ParseExtensionsElement(XmlReader reader, string baseDirectory)
{
try
{
+#if SILVERLIGHT
+ var si = Application.GetResourceStream(new Uri(assemblyFile, UriKind.Relative));
+ var assemblyPart = new AssemblyPart();
+ Assembly asm = assemblyPart.Load(si.Stream);
+#else
+
string fullFileName = Path.Combine(baseDirectory, assemblyFile);
InternalLogger.Info("Loading assemblyFile: {0}", fullFileName);
- Assembly asm = Assembly.LoadFrom(fullFileName);
+ Assembly asm = Assembly.LoadFrom(fullFileName);
+#endif
this.nlogFactories.RegisterItemsFromAssembly(asm, prefix);
}
catch (Exception ex)
@@ -759,7 +770,13 @@ private void ParseExtensionsElement(XmlReader reader, string baseDirectory)
try
{
InternalLogger.Info("Loading assemblyName: {0}", assemblyName);
+#if SILVERLIGHT
+ var si = Application.GetResourceStream(new Uri(assemblyName + ".dll", UriKind.Relative));
+ var assemblyPart = new AssemblyPart();
+ Assembly asm = assemblyPart.Load(si.Stream);
+#else
Assembly asm = Assembly.Load(assemblyName);
+#endif
this.nlogFactories.RegisterItemsFromAssembly(asm, prefix);
}
View
190 tests/NLog.UnitTests/Config/ExtensionTests.cs
@@ -0,0 +1,190 @@
+//
+// Copyright (c) 2004-2010 Jaroslaw Kowalski <jaak@jkowalski.net>
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// * Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// * Neither the name of Jaroslaw Kowalski nor the names of its
+// contributors may be used to endorse or promote products derived from this
+// software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+//
+
+namespace NLog.UnitTests.Config
+{
+ using System;
+ using System.IO;
+ using Microsoft.VisualStudio.TestTools.UnitTesting;
+ using MyExtensionNamespace;
+ using NLog.Filters;
+ using NLog.Layouts;
+ using NLog.Targets;
+
+ [TestClass]
+ public class ExtensionTests : NLogTestBase
+ {
+ private string extensionAssemblyName1 = "SampleExtensions";
+#if SILVERLIGHT || NET_CF
+ private string extensionAssemblyFullPath1 = "SampleExtensions.dll";
+#else
+ private string extensionAssemblyFullPath1 = Path.GetFullPath("SampleExtensions.dll");
+#endif
+
+ // this is to force NLog.UnitTests.dll to have a reference to SampleExtensions.dll
+ private Type type = typeof(FooLayout);
+
+ [TestMethod]
+ public void ExtensionTest1()
+ {
+ var configuration = CreateConfigurationFromString(@"
+<nlog throwExceptions='true'>
+ <extensions>
+ <add assemblyFile='" + this.extensionAssemblyFullPath1 + @"' />
+ </extensions>
+
+ <targets>
+ <target name='t' type='MyTarget' />
+ <target name='d1' type='Debug' layout='${foo}' />
+ <target name='d2' type='Debug'>
+ <layout type='FooLayout' x='1'>
+ </layout>
+ </target>
+ </targets>
+
+ <rules>
+ <logger name='*' writeTo='t'>
+ <filters>
+ <whenFoo x='44' action='Ignore' />
+ </filters>
+ </logger>
+ </rules>
+</nlog>");
+
+ Target myTarget = configuration.FindTargetByName("t");
+ Assert.AreEqual("MyExtensionNamespace.MyTarget", myTarget.GetType().FullName);
+
+ var d1Target = (DebugTarget)configuration.FindTargetByName("d1");
+ var layout = d1Target.Layout as SimpleLayout;
+ Assert.IsNotNull(layout);
+ Assert.AreEqual(1, layout.Renderers.Count);
+ Assert.AreEqual("MyExtensionNamespace.FooLayoutRenderer", layout.Renderers[0].GetType().FullName);
+
+ var d2Target = (DebugTarget)configuration.FindTargetByName("d2");
+ Assert.AreEqual("MyExtensionNamespace.FooLayout", d2Target.Layout.GetType().FullName);
+
+ Assert.AreEqual(1, configuration.LoggingRules[0].Filters.Count);
+ Assert.AreEqual("MyExtensionNamespace.WhenFooFilter", configuration.LoggingRules[0].Filters[0].GetType().FullName);
+ }
+
+ [TestMethod]
+ public void ExtensionTest2()
+ {
+ var configuration = CreateConfigurationFromString(@"
+<nlog throwExceptions='true'>
+ <extensions>
+ <add assembly='" + this.extensionAssemblyName1 + @"' />
+ </extensions>
+
+ <targets>
+ <target name='t' type='MyTarget' />
+ <target name='d1' type='Debug' layout='${foo}' />
+ <target name='d2' type='Debug'>
+ <layout type='FooLayout' x='1'>
+ </layout>
+ </target>
+ </targets>
+
+ <rules>
+ <logger name='*' writeTo='t'>
+ <filters>
+ <whenFoo x='44' action='Ignore' />
+ <when condition='myrandom(10)==3' action='Accept' />
+ </filters>
+ </logger>
+ </rules>
+</nlog>");
+
+ Target myTarget = configuration.FindTargetByName("t");
+ Assert.AreEqual("MyExtensionNamespace.MyTarget", myTarget.GetType().FullName);
+
+ var d1Target = (DebugTarget)configuration.FindTargetByName("d1");
+ var layout = d1Target.Layout as SimpleLayout;
+ Assert.IsNotNull(layout);
+ Assert.AreEqual(1, layout.Renderers.Count);
+ Assert.AreEqual("MyExtensionNamespace.FooLayoutRenderer", layout.Renderers[0].GetType().FullName);
+
+ var d2Target = (DebugTarget)configuration.FindTargetByName("d2");
+ Assert.AreEqual("MyExtensionNamespace.FooLayout", d2Target.Layout.GetType().FullName);
+
+ Assert.AreEqual(2, configuration.LoggingRules[0].Filters.Count);
+ Assert.AreEqual("MyExtensionNamespace.WhenFooFilter", configuration.LoggingRules[0].Filters[0].GetType().FullName);
+ var cbf = configuration.LoggingRules[0].Filters[1] as ConditionBasedFilter;
+ Assert.IsNotNull(cbf);
+ Assert.AreEqual("(myrandom(10) == 3)", cbf.Condition.ToString());
+ }
+
+ [TestMethod]
+ public void ExtensionWithPrefixTest()
+ {
+ var configuration = CreateConfigurationFromString(@"
+<nlog throwExceptions='true'>
+ <extensions>
+ <add prefix='myprefix' assemblyFile='" + this.extensionAssemblyFullPath1 + @"' />
+ </extensions>
+
+ <targets>
+ <target name='t' type='myprefix.MyTarget' />
+ <target name='d1' type='Debug' layout='${myprefix.foo}' />
+ <target name='d2' type='Debug'>
+ <layout type='myprefix.FooLayout' x='1'>
+ </layout>
+ </target>
+ </targets>
+
+ <rules>
+ <logger name='*' writeTo='t'>
+ <filters>
+ <myprefix.whenFoo x='44' action='Ignore' />
+ </filters>
+ </logger>
+ </rules>
+</nlog>");
+
+ Target myTarget = configuration.FindTargetByName("t");
+ Assert.AreEqual("MyExtensionNamespace.MyTarget", myTarget.GetType().FullName);
+
+ var d1Target = (DebugTarget)configuration.FindTargetByName("d1");
+ var layout = d1Target.Layout as SimpleLayout;
+ Assert.IsNotNull(layout);
+ Assert.AreEqual(1, layout.Renderers.Count);
+ Assert.AreEqual("MyExtensionNamespace.FooLayoutRenderer", layout.Renderers[0].GetType().FullName);
+
+ var d2Target = (DebugTarget)configuration.FindTargetByName("d2");
+ Assert.AreEqual("MyExtensionNamespace.FooLayout", d2Target.Layout.GetType().FullName);
+
+ Assert.AreEqual(1, configuration.LoggingRules[0].Filters.Count);
+ Assert.AreEqual("MyExtensionNamespace.WhenFooFilter", configuration.LoggingRules[0].Filters[0].GetType().FullName);
+ }
+ }
+}
View
72 tests/NLog.UnitTests/Config/VariableTests.cs
@@ -0,0 +1,72 @@
+//
+// Copyright (c) 2004-2010 Jaroslaw Kowalski <jaak@jkowalski.net>
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// * Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// * Neither the name of Jaroslaw Kowalski nor the names of its
+// contributors may be used to endorse or promote products derived from this
+// software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+//
+
+namespace NLog.UnitTests.Config
+{
+ using Microsoft.VisualStudio.TestTools.UnitTesting;
+ using NLog.LayoutRenderers;
+ using NLog.Layouts;
+ using NLog.Targets;
+
+ [TestClass]
+ public class VariableTests : NLogTestBase
+ {
+ [TestMethod]
+ public void VariablesTest1()
+ {
+ var configuration = CreateConfigurationFromString(@"
+<nlog throwExceptions='true'>
+ <variable name='prefix' value='[[' />
+ <variable name='suffix' value=']]' />
+
+ <targets>
+ <target name='d1' type='Debug' layout='${prefix}${message}${suffix}' />
+ </targets>
+</nlog>");
+
+ var d1 = configuration.FindTargetByName("d1") as DebugTarget;
+ Assert.IsNotNull(d1);
+ var layout = d1.Layout as SimpleLayout;
+ Assert.IsNotNull(layout);
+ Assert.AreEqual(3, layout.Renderers.Count);
+ var lr1 = layout.Renderers[0] as LiteralLayoutRenderer;
+ var lr2 = layout.Renderers[1] as MessageLayoutRenderer;
+ var lr3 = layout.Renderers[2] as LiteralLayoutRenderer;
+ Assert.IsNotNull(lr1);
+ Assert.IsNotNull(lr2);
+ Assert.IsNotNull(lr3);
+ Assert.AreEqual("[[", lr1.Text);
+ Assert.AreEqual("]]", lr3.Text);
+ }
+ }
+}
View
9 tests/NLog.UnitTests/NLog.UnitTests.netcf20.csproj
@@ -12,7 +12,8 @@
<PlatformFamilyName>PocketPC</PlatformFamilyName>
<OSVersion>4.20</OSVersion>
<DeployDirSuffix>TestProject1</DeployDirSuffix>
- <FormFactorID></FormFactorID>
+ <FormFactorID>
+ </FormFactorID>
<WarningLevel>4</WarningLevel>
<ProjectTypeGuids>{73A5A715-AF05-47af-9C33-47A864AF9AE7};{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<NativePlatformName>Pocket PC 2003</NativePlatformName>
@@ -73,8 +74,10 @@
<Compile Include="Conditions\ConditionEvaluatorTests.cs" />
<Compile Include="Conditions\ConditionParserTests.cs" />
<Compile Include="Config\CaseSensitivityTests.cs" />
+ <Compile Include="Config\ExtensionTests.cs" />
<Compile Include="Config\IncludeTests.cs" />
<Compile Include="Config\TargetConfigurationTests.cs" />
+ <Compile Include="Config\VariableTests.cs" />
<Compile Include="Contexts\GlobalDiagnosticsContextTests.cs" />
<Compile Include="Contexts\MappedDiagnosticsContextTests.cs" />
<Compile Include="Contexts\NestedDiagnosticsContextTests.cs" />
@@ -149,6 +152,10 @@
<Project>{63381160-DCF9-4011-9EE6-98AEFA6462C8}</Project>
<Name>NLog.netcf20</Name>
</ProjectReference>
+ <ProjectReference Include="..\SampleExtensions\SampleExtensions.netcf20.csproj">
+ <Project>{C6558721-BA0E-488A-AE61-87D46BEF1E16}</Project>
+ <Name>SampleExtensions.netcf20</Name>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
View
9 tests/NLog.UnitTests/NLog.UnitTests.netcf35.csproj
@@ -14,7 +14,8 @@
<OSVersion>4.20</OSVersion>
<DeployDirSuffix>TestProject1</DeployDirSuffix>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FormFactorID></FormFactorID>
+ <FormFactorID>
+ </FormFactorID>
<WarningLevel>4</WarningLevel>
<ProjectTypeGuids>{73A5A715-AF05-47af-9C33-47A864AF9AE7};{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<NativePlatformName>Pocket PC 2003</NativePlatformName>
@@ -70,8 +71,10 @@
<Compile Include="Conditions\ConditionEvaluatorTests.cs" />
<Compile Include="Conditions\ConditionParserTests.cs" />
<Compile Include="Config\CaseSensitivityTests.cs" />
+ <Compile Include="Config\ExtensionTests.cs" />
<Compile Include="Config\IncludeTests.cs" />
<Compile Include="Config\TargetConfigurationTests.cs" />
+ <Compile Include="Config\VariableTests.cs" />
<Compile Include="Contexts\GlobalDiagnosticsContextTests.cs" />
<Compile Include="Contexts\MappedDiagnosticsContextTests.cs" />
<Compile Include="Contexts\NestedDiagnosticsContextTests.cs" />
@@ -146,6 +149,10 @@
<Project>{ECF62FFC-DD3B-446D-BA0A-FFE020D5A90A}</Project>
<Name>NLog.netcf35</Name>
</ProjectReference>
+ <ProjectReference Include="..\SampleExtensions\SampleExtensions.netcf35.csproj">
+ <Project>{2A1AFF0C-0C26-4B2E-95C5-BCFBBE343031}</Project>
+ <Name>SampleExtensions.netcf35</Name>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
View
12 tests/NLog.UnitTests/NLog.UnitTests.netfx20.csproj
@@ -8,8 +8,10 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)'==''">v2.0</TargetFrameworkVersion>
- <ApplicationIcon></ApplicationIcon>
- <AssemblyKeyContainerName></AssemblyKeyContainerName>
+ <ApplicationIcon>
+ </ApplicationIcon>
+ <AssemblyKeyContainerName>
+ </AssemblyKeyContainerName>
<AssemblyName>NLog.UnitTests</AssemblyName>
<AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
@@ -67,8 +69,10 @@
<Compile Include="Conditions\ConditionEvaluatorTests.cs" />
<Compile Include="Conditions\ConditionParserTests.cs" />
<Compile Include="Config\CaseSensitivityTests.cs" />
+ <Compile Include="Config\ExtensionTests.cs" />
<Compile Include="Config\IncludeTests.cs" />
<Compile Include="Config\TargetConfigurationTests.cs" />
+ <Compile Include="Config\VariableTests.cs" />
<Compile Include="Contexts\GlobalDiagnosticsContextTests.cs" />
<Compile Include="Contexts\MappedDiagnosticsContextTests.cs" />
<Compile Include="Contexts\NestedDiagnosticsContextTests.cs" />
@@ -143,6 +147,10 @@
<Project>{B71A9EF1-2493-4B7B-AB82-8C7A83C10952}</Project>
<Name>NLog.netfx20</Name>
</ProjectReference>
+ <ProjectReference Include="..\SampleExtensions\SampleExtensions.netfx20.csproj">
+ <Project>{1653EE05-2720-4A85-BF14-74C4593787B1}</Project>
+ <Name>SampleExtensions.netfx20</Name>
+ </ProjectReference>
</ItemGroup>
<Import Project="$(StyleCopTargetsFile)" Condition="'$(StyleCopTargetsFile)' != ''" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
View
12 tests/NLog.UnitTests/NLog.UnitTests.netfx35.csproj
@@ -8,8 +8,10 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)'==''">v3.5</TargetFrameworkVersion>
- <ApplicationIcon></ApplicationIcon>
- <AssemblyKeyContainerName></AssemblyKeyContainerName>
+ <ApplicationIcon>
+ </ApplicationIcon>
+ <AssemblyKeyContainerName>
+ </AssemblyKeyContainerName>
<AssemblyName>NLog.UnitTests</AssemblyName>
<AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
@@ -72,8 +74,10 @@
<Compile Include="Conditions\ConditionEvaluatorTests.cs" />
<Compile Include="Conditions\ConditionParserTests.cs" />
<Compile Include="Config\CaseSensitivityTests.cs" />
+ <Compile Include="Config\ExtensionTests.cs" />
<Compile Include="Config\IncludeTests.cs" />
<Compile Include="Config\TargetConfigurationTests.cs" />
+ <Compile Include="Config\VariableTests.cs" />
<Compile Include="Contexts\GlobalDiagnosticsContextTests.cs" />
<Compile Include="Contexts\MappedDiagnosticsContextTests.cs" />
<Compile Include="Contexts\NestedDiagnosticsContextTests.cs" />
@@ -152,6 +156,10 @@
<Project>{C124B63D-1658-4311-9BA8-9C3CFAF9B32E}</Project>
<Name>NLog.netfx35</Name>
</ProjectReference>
+ <ProjectReference Include="..\SampleExtensions\SampleExtensions.netfx35.csproj">
+ <Project>{A8CA32F1-BD4C-4A99-B307-99A93DB64B9F}</Project>
+ <Name>SampleExtensions.netfx35</Name>
+ </ProjectReference>
</ItemGroup>
<Import Project="$(StyleCopTargetsFile)" Condition="'$(StyleCopTargetsFile)' != ''" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
View
13 tests/NLog.UnitTests/NLog.UnitTests.netfx40.csproj
@@ -8,8 +8,10 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <ApplicationIcon></ApplicationIcon>
- <AssemblyKeyContainerName></AssemblyKeyContainerName>
+ <ApplicationIcon>
+ </ApplicationIcon>
+ <AssemblyKeyContainerName>
+ </AssemblyKeyContainerName>
<AssemblyName>NLog.UnitTests</AssemblyName>
<AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
@@ -69,8 +71,10 @@
<Compile Include="Conditions\ConditionEvaluatorTests.cs" />
<Compile Include="Conditions\ConditionParserTests.cs" />
<Compile Include="Config\CaseSensitivityTests.cs" />
+ <Compile Include="Config\ExtensionTests.cs" />
<Compile Include="Config\IncludeTests.cs" />
<Compile Include="Config\TargetConfigurationTests.cs" />
+ <Compile Include="Config\VariableTests.cs" />
<Compile Include="Contexts\GlobalDiagnosticsContextTests.cs" />
<Compile Include="Contexts\MappedDiagnosticsContextTests.cs" />
<Compile Include="Contexts\NestedDiagnosticsContextTests.cs" />
@@ -149,8 +153,11 @@
<Project>{A0BFF0DB-ED9A-4639-AE86-8E709A1EFC66}</Project>
<Name>NLog.netfx40</Name>
</ProjectReference>
+ <ProjectReference Include="..\SampleExtensions\SampleExtensions.netfx40.csproj">
+ <Project>{FE067913-E9A8-41F0-89FA-C1136F8FB6A8}</Project>
+ <Name>SampleExtensions.netfx40</Name>
+ </ProjectReference>
</ItemGroup>
- <ItemGroup />
<Import Project="$(StyleCopTargetsFile)" Condition="'$(StyleCopTargetsFile)' != ''" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
View
50 tests/NLog.UnitTests/NLog.UnitTests.sl2.csproj
@@ -13,7 +13,8 @@
<AssemblyName>NLog.UnitTests</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<SilverlightApplication>true</SilverlightApplication>
- <SupportedCultures></SupportedCultures>
+ <SupportedCultures>
+ </SupportedCultures>
<XapOutputs>true</XapOutputs>
<SilverlightVersion Condition="'$(SilverlightVersion)' == ''">v2.0</SilverlightVersion>
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
@@ -27,12 +28,15 @@
<OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
<UsePlatformExtensions>false</UsePlatformExtensions>
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
- <LinkedServerProject></LinkedServerProject>
+ <LinkedServerProject>
+ </LinkedServerProject>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
- <FileUpgradeFlags></FileUpgradeFlags>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
- <UpgradeBackupLocation></UpgradeBackupLocation>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
@@ -100,8 +104,10 @@
<Compile Include="Conditions\ConditionEvaluatorTests.cs" />
<Compile Include="Conditions\ConditionParserTests.cs" />
<Compile Include="Config\CaseSensitivityTests.cs" />
+ <Compile Include="Config\ExtensionTests.cs" />
<Compile Include="Config\IncludeTests.cs" />
<Compile Include="Config\TargetConfigurationTests.cs" />
+ <Compile Include="Config\VariableTests.cs" />
<Compile Include="Contexts\GlobalDiagnosticsContextTests.cs" />
<Compile Include="Contexts\MappedDiagnosticsContextTests.cs" />
<Compile Include="Contexts\NestedDiagnosticsContextTests.cs" />
@@ -191,38 +197,10 @@
<Project>{7D970521-54A6-4C21-9764-1219481A54C3}</Project>
<Name>NLog.sl2</Name>
</ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
+ <ProjectReference Include="..\SampleExtensions\SampleExtensions.sl2.csproj">
+ <Project>{D172C49A-55C9-47B3-B3F7-40D5AB64E8E8}</Project>
+ <Name>SampleExtensions.sl2</Name>
+ </ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\v2.0\Microsoft.Silverlight.CSharp.targets" Condition="" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
View
12 tests/NLog.UnitTests/NLog.UnitTests.sl3.csproj
@@ -16,7 +16,8 @@
<AssemblyName>NLog.UnitTests</AssemblyName>
<TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
<SilverlightApplication>true</SilverlightApplication>
- <SupportedCultures></SupportedCultures>
+ <SupportedCultures>
+ </SupportedCultures>
<XapOutputs>true</XapOutputs>
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
@@ -30,7 +31,8 @@
<OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
<UsePlatformExtensions>false</UsePlatformExtensions>
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
- <LinkedServerProject></LinkedServerProject>
+ <LinkedServerProject>
+ </LinkedServerProject>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
@@ -86,8 +88,10 @@
<Compile Include="Conditions\ConditionEvaluatorTests.cs" />
<Compile Include="Conditions\ConditionParserTests.cs" />
<Compile Include="Config\CaseSensitivityTests.cs" />
+ <Compile Include="Config\ExtensionTests.cs" />
<Compile Include="Config\IncludeTests.cs" />
<Compile Include="Config\TargetConfigurationTests.cs" />
+ <Compile Include="Config\VariableTests.cs" />
<Compile Include="Contexts\GlobalDiagnosticsContextTests.cs" />
<Compile Include="Contexts\MappedDiagnosticsContextTests.cs" />
<Compile Include="Contexts\NestedDiagnosticsContextTests.cs" />
@@ -179,6 +183,10 @@
<Project>{E7AB20BF-6920-442A-B876-CC05BC5CEC79}</Project>
<Name>NLog.sl3</Name>
</ProjectReference>
+ <ProjectReference Include="..\SampleExtensions\SampleExtensions.sl3.csproj">
+ <Project>{C48047FF-7E14-443D-906D-7E021AB5307A}</Project>
+ <Name>SampleExtensions.sl3</Name>
+ </ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
View
12 tests/NLog.UnitTests/NLog.UnitTests.sl4.csproj
@@ -16,7 +16,8 @@
<AssemblyName>NLog.UnitTests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<SilverlightApplication>true</SilverlightApplication>
- <SupportedCultures></SupportedCultures>
+ <SupportedCultures>
+ </SupportedCultures>
<XapOutputs>true</XapOutputs>
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
@@ -30,7 +31,8 @@
<OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
<UsePlatformExtensions>false</UsePlatformExtensions>
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
- <LinkedServerProject></LinkedServerProject>
+ <LinkedServerProject>
+ </LinkedServerProject>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
@@ -87,8 +89,10 @@
<Compile Include="Conditions\ConditionEvaluatorTests.cs" />
<Compile Include="Conditions\ConditionParserTests.cs" />
<Compile Include="Config\CaseSensitivityTests.cs" />
+ <Compile Include="Config\ExtensionTests.cs" />
<Compile Include="Config\IncludeTests.cs" />
<Compile Include="Config\TargetConfigurationTests.cs" />
+ <Compile Include="Config\VariableTests.cs" />
<Compile Include="Contexts\GlobalDiagnosticsContextTests.cs" />
<Compile Include="Contexts\MappedDiagnosticsContextTests.cs" />
<Compile Include="Contexts\NestedDiagnosticsContextTests.cs" />
@@ -180,6 +184,10 @@
<Project>{E7AB20BF-6920-442A-B876-CC06BC5CEC79}</Project>
<Name>NLog.sl4</Name>
</ProjectReference>
+ <ProjectReference Include="..\SampleExtensions\SampleExtensions.sl4.csproj">
+ <Project>{C480452F-7E14-443D-906D-7E021AB5707A}</Project>
+ <Name>SampleExtensions.sl4</Name>
+ </ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
View
9 tests/NLog.UnitTests/NLogTestBase.cs
@@ -44,6 +44,7 @@
namespace NLog.UnitTests
{
+ using System;
using NLog.Internal;
using NLog.Common;
@@ -118,7 +119,13 @@ protected XmlLoggingConfiguration CreateConfigurationFromString(string configXml
XmlDocument doc = new XmlDocument();
doc.LoadXml(configXml);
- return new XmlLoggingConfiguration(doc.DocumentElement, null);
+#if NET_CF
+ Console.WriteLine(CompactFrameworkHelper.GetExeBaseDir());
+ return new XmlLoggingConfiguration(doc.DocumentElement, ".");
+#else
+ return new XmlLoggingConfiguration(doc.DocumentElement, Environment.CurrentDirectory);
+#endif
+
#endif
}
View
55 tests/SampleExtensions/FooLayout.cs
@@ -0,0 +1,55 @@
+//
+// Copyright (c) 2004-2010 Jaroslaw Kowalski <jaak@jkowalski.net>
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// * Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// * Neither the name of Jaroslaw Kowalski nor the names of its
+// contributors may be used to endorse or promote products derived from this
+// software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+//
+
+namespace MyExtensionNamespace
+{
+ using NLog;
+ using NLog.Layouts;
+
+ [Layout("FooLayout")]
+ public class FooLayout : Layout
+ {
+ private int x;
+
+ public int X
+ {
+ get { return this.x; }
+ set { this.x = value; }
+ }
+
+ protected override string GetFormattedMessage(LogEventInfo logEvent)
+ {
+ return "FooFoo" + this.X;
+ }
+ }
+}
View
49 tests/SampleExtensions/FooLayoutRenderer.cs
@@ -0,0 +1,49 @@
+//
+// Copyright (c) 2004-2010 Jaroslaw Kowalski <jaak@jkowalski.net>
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// * Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// * Neither the name of Jaroslaw Kowalski nor the names of its
+// contributors may be used to endorse or promote products derived from this
+// software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+//
+
+namespace MyExtensionNamespace
+{
+ using System.Text;
+
+ using NLog;
+ using NLog.LayoutRenderers;
+
+ [LayoutRenderer("foo")]
+ public class FooLayoutRenderer : LayoutRenderer
+ {
+ protected override void Append(StringBuilder buffer, LogEventInfo logEvent)
+ {
+ buffer.Append("foo");
+ }
+ }
+}
View
49 tests/SampleExtensions/MyConditionMethods.cs
@@ -0,0 +1,49 @@
+//
+// Copyright (c) 2004-2010 Jaroslaw Kowalski <jaak@jkowalski.net>
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// * Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// * Neither the name of Jaroslaw Kowalski nor the names of its
+// contributors may be used to endorse or promote products derived from this
+// software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+//
+
+namespace MyExtensionNamespace
+{
+ using System;
+
+ using NLog.Conditions;
+
+ [ConditionMethods]
+ public static class MyConditionMethods
+ {
+ [ConditionMethod("myrandom")]
+ public static int Random(int max)
+ {
+ return new Random().Next(max);
+ }
+ }
+}
View
47 tests/SampleExtensions/MyTarget.cs
@@ -0,0 +1,47 @@
+//
+// Copyright (c) 2004-2010 Jaroslaw Kowalski <jaak@jkowalski.net>
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// * Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// * Neither the name of Jaroslaw Kowalski nor the names of its
+// contributors may be used to endorse or promote products derived from this
+// software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+//
+
+namespace MyExtensionNamespace
+{
+ using NLog;
+ using NLog.Targets;
+
+ [Target("MyTarget")]
+ public class MyTarget : Target
+ {
+ protected override void Write(LogEventInfo logEvent)
+ {
+ // do nothing
+ }
+ }
+}
View
BIN  tests/SampleExtensions/NLogTests.snk
Binary file not shown
View
60 tests/SampleExtensions/ProjectFileInfo.xml
@@ -0,0 +1,60 @@
+<ProjectFiles>
+ <!--
+ this file contains information necessary to regenerate Compile items in all NLog project files
+ based on contents of this directory
+
+ The file is processed by SyncProjectItems.exe in tools directory.
+ -->
+
+ <FileSet Name="AllFilesToCompile">
+ <Include File="*.cs" />
+ </FileSet>
+
+ <Project File="SampleExtensions.sl2.csproj">
+ <ItemGroup Name="Compile">
+ <FileSet Include="AllFilesToCompile" />
+ </ItemGroup>
+ </Project>
+
+ <Project File="SampleExtensions.sl3.csproj">
+ <ItemGroup Name="Compile">
+ <FileSet Include="AllFilesToCompile" />
+ </ItemGroup>
+ </Project>
+
+ <Project File="SampleExtensions.sl4.csproj">
+ <ItemGroup Name="Compile">
+ <FileSet Include="AllFilesToCompile" />
+ </ItemGroup>
+ </Project>
+
+ <Project File="SampleExtensions.netfx20.csproj">
+ <ItemGroup Name="Compile">
+ <FileSet Include="AllFilesToCompile" />
+ </ItemGroup>
+ </Project>
+
+ <Project File="SampleExtensions.netcf20.csproj">
+ <ItemGroup Name="Compile">
+ <FileSet Include="AllFilesToCompile" />
+ </ItemGroup>
+ </Project>
+
+ <Project File="SampleExtensions.netcf35.csproj">
+ <ItemGroup Name="Compile">
+ <FileSet Include="AllFilesToCompile" />
+ </ItemGroup>
+ </Project>
+
+ <Project File="SampleExtensions.netfx35.csproj">
+ <ItemGroup Name="Compile">
+ <FileSet Include="AllFilesToCompile" />
+ </ItemGroup>
+ </Project>
+
+ <Project File="SampleExtensions.netfx40.csproj">
+ <ItemGroup Name="Compile">
+ <FileSet Include="AllFilesToCompile" />
+ </ItemGroup>
+ </Project>
+</ProjectFiles>
View
88 tests/SampleExtensions/SampleExtensions.netcf20.csproj
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{C6558721-BA0E-488A-AE61-87D46BEF1E16}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <RootNamespace>SampleExtensions</RootNamespace>
+ <AssemblyName>SampleExtensions</AssemblyName>
+ <PlatformFamilyName>PocketPC</PlatformFamilyName>
+ <OSVersion>4.20</OSVersion>
+ <DeployDirSuffix>TestProject1</DeployDirSuffix>
+ <FormFactorID></FormFactorID>
+ <WarningLevel>4</WarningLevel>
+ <ProjectTypeGuids>{73A5A715-AF05-47af-9C33-47A864AF9AE7};{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <NativePlatformName>Pocket PC 2003</NativePlatformName>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
+ <PlatformFamilyName>PocketPC</PlatformFamilyName>
+ <PlatformID>3C41C503-53EF-4c2a-8DD4-A8217CAD115E</PlatformID>
+ <OSVersion>4.20</OSVersion>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <NativePlatformName>Pocket PC 2003</NativePlatformName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <FileAlignment>512</FileAlignment>
+ <WarningLevel>4</WarningLevel>
+ <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
+ <DefineConstants>DEBUG;TRACE;$(PlatformFamilyName)</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugSymbols>false</DebugSymbols>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE;$(PlatformFamilyName)</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <FileAlignment>512</FileAlignment>
+ <WarningLevel>4</WarningLevel>
+ <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
+ </PropertyGroup>
+ <PropertyGroup>
+ <TargetFrameworkName>.NET Compact Framework 2.0</TargetFrameworkName>
+ <DefineConstants>NET_CF;NETCF2_0;$(DefineConstants)</DefineConstants>
+ <OutputPath>$(BaseOutputDirectory)bin\$(Configuration)\$(TargetFrameworkName)</OutputPath>
+ <IntermediateOutputPath>$(BaseOutputDirectory)obj\$(Configuration)\$(TargetFrameworkName)</IntermediateOutputPath>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="FooLayout.cs" />
+ <Compile Include="FooLayoutRenderer.cs" />
+ <Compile Include="MyConditionMethods.cs" />
+ <Compile Include="MyTarget.cs" />
+ <Compile Include="WhenFooFilter.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="NLogTests.snk" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\NLog\NLog.netcf20.csproj">
+ <Project>{63381160-DCF9-4011-9EE6-98AEFA6462C8}</Project>
+ <Name>NLog.netcf20</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Properties\" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
+ <PropertyGroup>
+ <DeviceTestAssemblySearchPath>$(VS90COMNTOOLS)..\IDE\PublicAssemblies</DeviceTestAssemblySearchPath>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblySearchPaths>$(DeviceTestAssemblySearchPath);$(AssemblySearchPaths)</AssemblySearchPaths>
+ </PropertyGroup>
+</Project>
View
85 tests/SampleExtensions/SampleExtensions.netcf35.csproj
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{2A1AFF0C-0C26-4B2E-95C5-BCFBBE343031}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <RootNamespace>SampleExtensions</RootNamespace>
+ <AssemblyName>SampleExtensions</AssemblyName>
+ <PlatformFamilyName>PocketPC</PlatformFamilyName>
+ <PlatformID>3C41C503-53EF-4c2a-8DD4-A8217CAD115E</PlatformID>
+ <OSVersion>4.20</OSVersion>
+ <DeployDirSuffix>TestProject1</DeployDirSuffix>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FormFactorID></FormFactorID>
+ <WarningLevel>4</WarningLevel>
+ <ProjectTypeGuids>{73A5A715-AF05-47af-9C33-47A864AF9AE7};{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <NativePlatformName>Pocket PC 2003</NativePlatformName>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <FileAlignment>512</FileAlignment>
+ <WarningLevel>4</WarningLevel>
+ <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
+ <DefineConstants>DEBUG;TRACE;$(PlatformFamilyName)</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugSymbols>false</DebugSymbols>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE;$(PlatformFamilyName)</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <FileAlignment>512</FileAlignment>
+ <WarningLevel>4</WarningLevel>
+ <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
+ </PropertyGroup>
+ <PropertyGroup>
+ <TargetFrameworkName>.NET Compact Framework 3.5</TargetFrameworkName>
+ <DefineConstants>NET_CF;NETCF3_5;$(DefineConstants)</DefineConstants>
+ <OutputPath>$(BaseOutputDirectory)bin\$(Configuration)\$(TargetFrameworkName)</OutputPath>
+ <IntermediateOutputPath>$(BaseOutputDirectory)obj\$(Configuration)\$(TargetFrameworkName)</IntermediateOutputPath>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="FooLayout.cs" />
+ <Compile Include="FooLayoutRenderer.cs" />
+ <Compile Include="MyConditionMethods.cs" />
+ <Compile Include="MyTarget.cs" />
+ <Compile Include="WhenFooFilter.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="NLogTests.snk" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\NLog\NLog.netcf35.csproj">
+ <Project>{ECF62FFC-DD3B-446D-BA0A-FFE020D5A90A}</Project>
+ <Name>NLog.netcf35</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Properties\" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
+ <PropertyGroup>
+ <DeviceTestAssemblySearchPath>$(VS90COMNTOOLS)..\IDE\PublicAssemblies</DeviceTestAssemblySearchPath>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblySearchPaths>$(DeviceTestAssemblySearchPath);$(AssemblySearchPaths)</AssemblySearchPaths>
+ </PropertyGroup>
+</Project>
View
74 tests/SampleExtensions/SampleExtensions.netfx20.csproj
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+ <PropertyGroup>
+ <ProjectType>Local</ProjectType>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{1653EE05-2720-4A85-BF14-74C4593787B1}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)'==''">v2.0</TargetFrameworkVersion>
+ <ApplicationIcon></ApplicationIcon>
+ <AssemblyKeyContainerName></AssemblyKeyContainerName>
+ <AssemblyName>SampleExtensions</AssemblyName>
+ <AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
+ <DelaySign>false</DelaySign>
+ <OutputType>Library</OutputType>
+ <RootNamespace>SampleExtensions</RootNamespace>
+ <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
+ <SignAssembly>true</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <OutputPath>bin\Debug\</OutputPath>
+ <BaseAddress>285212672</BaseAddress>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <Optimize>false</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>full</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <OutputPath>bin\Release\</OutputPath>
+ <BaseAddress>285212672</BaseAddress>
+ <DefineConstants>TRACE</DefineConstants>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <Optimize>true</Optimize>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>pdbonly</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup>
+ <TargetFrameworkName>.NET Framework 2.0</TargetFrameworkName>
+ <DefineConstants>NET2_0;$(DefineConstants)</DefineConstants>
+ <OutputPath>$(BaseOutputDirectory)bin\$(Configuration)\$(TargetFrameworkName)</OutputPath>
+ <IntermediateOutputPath>$(BaseOutputDirectory)obj\$(Configuration)\$(TargetFrameworkName)</IntermediateOutputPath>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="FooLayout.cs" />
+ <Compile Include="FooLayoutRenderer.cs" />
+ <Compile Include="MyConditionMethods.cs" />
+ <Compile Include="MyTarget.cs" />
+ <Compile Include="WhenFooFilter.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="NLogTests.snk" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\NLog\NLog.netfx20.csproj">
+ <Project>{B71A9EF1-2493-4B7B-AB82-8C7A83C10952}</Project>
+ <Name>NLog.netfx20</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(StyleCopTargetsFile)" Condition="'$(StyleCopTargetsFile)' != ''" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>
View
78 tests/SampleExtensions/SampleExtensions.netfx35.csproj
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+ <PropertyGroup>
+ <ProjectType>Local</ProjectType>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{A8CA32F1-BD4C-4A99-B307-99A93DB64B9F}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)'==''">v3.5</TargetFrameworkVersion>
+ <ApplicationIcon></ApplicationIcon>
+ <AssemblyKeyContainerName></AssemblyKeyContainerName>
+ <AssemblyName>SampleExtensions</AssemblyName>
+ <AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
+ <DelaySign>false</DelaySign>
+ <OutputType>Library</OutputType>
+ <RootNamespace>SampleExtensions</RootNamespace>
+ <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
+ <SignAssembly>true</SignAssembly>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+ <TargetFrameworkSubset>Client</TargetFrameworkSubset>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <OutputPath>bin\Debug\</OutputPath>
+ <BaseAddress>285212672</BaseAddress>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <Optimize>false</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>full</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ <NoWarn>1591</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <OutputPath>bin\Release\</OutputPath>
+ <BaseAddress>285212672</BaseAddress>
+ <DefineConstants>TRACE</DefineConstants>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <Optimize>true</Optimize>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>pdbonly</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ <NoWarn>1591</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup>
+ <TargetFrameworkName>.NET Framework 3.5</TargetFrameworkName>
+ <DefineConstants>NET3_5;WCF_SUPPORTED;$(DefineConstants)</DefineConstants>
+ <OutputPath>$(BaseOutputDirectory)bin\$(Configuration)\$(TargetFrameworkName)</OutputPath>
+ <IntermediateOutputPath>$(BaseOutputDirectory)obj\$(Configuration)\$(TargetFrameworkName)</IntermediateOutputPath>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="FooLayout.cs" />
+ <Compile Include="FooLayoutRenderer.cs" />
+ <Compile Include="MyConditionMethods.cs" />
+ <Compile Include="MyTarget.cs" />
+ <Compile Include="WhenFooFilter.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="NLogTests.snk" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\NLog\NLog.netfx35.csproj">
+ <Project>{C124B63D-1658-4311-9BA8-9C3CFAF9B32E}</Project>
+ <Name>NLog.netfx35</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(StyleCopTargetsFile)" Condition="'$(StyleCopTargetsFile)' != ''" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>
View
74 tests/SampleExtensions/SampleExtensions.netfx40.csproj
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <PropertyGroup>
+ <ProjectType>Local</ProjectType>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{FE067913-E9A8-41F0-89FA-C1136F8FB6A8}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <ApplicationIcon></ApplicationIcon>
+ <AssemblyKeyContainerName></AssemblyKeyContainerName>
+ <AssemblyName>SampleExtensions</AssemblyName>
+ <AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
+ <DelaySign>false</DelaySign>
+ <OutputType>Library</OutputType>
+ <RootNamespace>SampleExtensions</RootNamespace>
+ <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
+ <SignAssembly>true</SignAssembly>
+ <NoWarn>1591</NoWarn>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <BaseAddress>285212672</BaseAddress>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <Optimize>false</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>full</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <BaseAddress>285212672</BaseAddress>
+ <DefineConstants>TRACE</DefineConstants>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <Optimize>true</Optimize>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>pdbonly</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup>
+ <TargetFrameworkName>.NET Framework 4.0</TargetFrameworkName>
+ <DefineConstants>NET4_0;WCF_SUPPORTED;$(DefineConstants)</DefineConstants>
+ <OutputPath>$(BaseOutputDirectory)bin\$(Configuration)\$(TargetFrameworkName)</OutputPath>
+ <IntermediateOutputPath>$(BaseOutputDirectory)obj\$(Configuration)\$(TargetFrameworkName)</IntermediateOutputPath>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="FooLayout.cs" />
+ <Compile Include="FooLayoutRenderer.cs" />
+ <Compile Include="MyConditionMethods.cs" />
+ <Compile Include="MyTarget.cs" />
+ <Compile Include="WhenFooFilter.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="NLogTests.snk" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\NLog\NLog.netfx40.csproj">
+ <Project>{A0BFF0DB-ED9A-4639-AE86-8E709A1EFC66}</Project>
+ <Name>NLog.netfx40</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(StyleCopTargetsFile)" Condition="'$(StyleCopTargetsFile)' != ''" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>
View
92 tests/SampleExtensions/SampleExtensions.sl2.csproj
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{D172C49A-55C9-47B3-B3F7-40D5AB64E8E8}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>SampleExtensions</RootNamespace>
+ <AssemblyName>SampleExtensions</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures></SupportedCultures>
+ <XapOutputs>false</XapOutputs>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <DefineConstants>TRACE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup>
+ <TargetFrameworkName>Silverlight 2.0</TargetFrameworkName>
+ <DefineConstants>SILVERLIGHT;SILVERLIGHT2;WCF_SUPPORTED;$(DefineConstants)</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <OutputPath>$(BaseOutputDirectory)bin\$(Configuration)\$(TargetFrameworkName)</OutputPath>
+ <IntermediateOutputPath>$(BaseOutputDirectory)obj\$(Configuration)\$(TargetFrameworkName)</IntermediateOutputPath>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="mscorlib" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="FooLayout.cs" />
+ <Compile Include="FooLayoutRenderer.cs" />
+ <Compile Include="MyConditionMethods.cs" />
+ <Compile Include="MyTarget.cs" />
+ <Compile Include="WhenFooFilter.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="NLogTests.snk" />
+ <None Include="Properties\AppManifest.xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <ItemGroup></ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\NLog\NLog.sl2.csproj">
+ <Project>{0D90976A-D1FD-4FEF-B7A9-9A40731C19EB}</Project>
+ <Name>NLog.sl2</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+</Project>
View
106 tests/SampleExtensions/SampleExtensions.sl3.csproj
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{C48047FF-7E14-443D-906D-7E021AB5307A}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>SampleExtensions</RootNamespace>
+ <AssemblyName>SampleExtensions</AssemblyName>
+ <TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures></SupportedCultures>
+ <XapOutputs>false</XapOutputs>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <DefineConstants>TRACE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup>
+ <TargetFrameworkName>Silverlight 3.0</TargetFrameworkName>
+ <DefineConstants>SILVERLIGHT;SILVERLIGHT3;WCF_SUPPORTED;$(DefineConstants)</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <OutputPath>$(BaseOutputDirectory)bin\$(Configuration)\$(TargetFrameworkName)</OutputPath>
+ <IntermediateOutputPath>$(BaseOutputDirectory)obj\$(Configuration)\$(TargetFrameworkName)</IntermediateOutputPath>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Silverlight.Testing, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\external\SilverlightUnitTestFramework\SL3\Microsoft.Silverlight.Testing.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\external\SilverlightUnitTestFramework\SL3\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Windows" />
+ <Reference Include="mscorlib" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ <Reference Include="System.Xml.Linq, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="FooLayout.cs" />
+ <Compile Include="FooLayoutRenderer.cs" />
+ <Compile Include="MyConditionMethods.cs" />
+ <Compile Include="MyTarget.cs" />
+ <Compile Include="WhenFooFilter.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="NLogTests.snk" />
+ <None Include="Properties\AppManifest.xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\NLog\NLog.sl3.csproj">
+ <Project>{E7AB20BF-6920-442A-B876-CC05BC5CEC79}</Project>
+ <Name>NLog.sl3</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+</Project>
View
106 tests/SampleExtensions/SampleExtensions.sl4.csproj
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{C480452F-7E14-443D-906D-7E021AB5707A}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>SampleExtensions</RootNamespace>
+ <AssemblyName>SampleExtensions</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures></SupportedCultures>
+ <XapOutputs>false</XapOutputs>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkProfile />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <DefineConstants>TRACE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup>
+ <TargetFrameworkName>Silverlight 4.0</TargetFrameworkName>
+ <DefineConstants>SILVERLIGHT;SILVERLIGHT4;WCF_SUPPORTED;$(DefineConstants)</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <OutputPath>$(BaseOutputDirectory)bin\$(Configuration)\$(TargetFrameworkName)</OutputPath>
+ <IntermediateOutputPath>$(BaseOutputDirectory)obj\$(Configuration)\$(TargetFrameworkName)</IntermediateOutputPath>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Silverlight.Testing, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\external\SilverlightUnitTestFramework\SL3\Microsoft.Silverlight.Testing.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\external\SilverlightUnitTestFramework\SL3\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Windows" />
+ <Reference Include="mscorlib" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ <Reference Include="System.Xml.Linq, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="FooLayout.cs" />
+ <Compile Include="FooLayoutRenderer.cs" />
+ <Compile Include="MyConditionMethods.cs" />
+ <Compile Include="MyTarget.cs" />
+ <Compile Include="WhenFooFilter.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="NLogTests.snk" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\NLog\NLog.sl4.csproj">
+ <Project>{E7AB20BF-6920-442A-B876-CC06BC5CEC79}</Project>
+ <Name>NLog.sl4</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Properties\" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+</Project>
View
60 tests/SampleExtensions/WhenFooFilter.cs
@@ -0,0 +1,60 @@
+//
+// Copyright (c) 2004-2010 Jaroslaw Kowalski <jaak@jkowalski.net>
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// * Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// * Neither the name of Jaroslaw Kowalski nor the names of its
+// contributors may be used to endorse or promote products derived from this
+// software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+//
+
+namespace MyExtensionNamespace
+{
+ using NLog;
+ using NLog.Filters;
+
+ [Filter("whenFoo")]
+ public class WhenFooFilter : Filter
+ {
+ private int x;
+
+ public int X
+ {
+ get { return this.x; }
+ set { this.x = value; }
+ }
+
+ protected override FilterResult Check(LogEventInfo logEvent)
+ {
+ if (X == 42)
+ {
+ return this.Action;
+ }
+
+ return FilterResult.Neutral;
+ }
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.