Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 8 commits
  • 51 files changed
  • 0 comments
  • 1 contributor

Showing 51 changed files with 284 additions and 58 deletions. Show diff stats Hide diff stats

  1. +9 0 Makefile
  2. +16 0 build.cmd
  3. +5 0 {tools → src}/InstallNLogConfig/InstallNLogConfig.mono2.csproj
  4. +5 0 {tools → src}/InstallNLogConfig/InstallNLogConfig.netfx20.csproj
  5. +5 0 {tools → src}/InstallNLogConfig/InstallNLogConfig.netfx35.csproj
  6. +5 0 {tools → src}/InstallNLogConfig/InstallNLogConfig.netfx40.csproj
  7. 0  {tools → src}/InstallNLogConfig/Program.cs
  8. +0 1  {tools → src}/InstallNLogConfig/Properties/AssemblyInfo.cs
  9. +6 1 src/NLog.Extended/NLog.Extended.mono2.csproj
  10. +5 0 src/NLog.Extended/NLog.Extended.monodevelop.csproj
  11. +6 1 src/NLog.Extended/NLog.Extended.netfx20.csproj
  12. +6 1 src/NLog.Extended/NLog.Extended.netfx35.csproj
  13. +6 1 src/NLog.Extended/NLog.Extended.netfx40.csproj
  14. +0 1  src/NLog.Extended/Properties/AssemblyInfo.cs
  15. +1 1  src/NLog.netfx20.sln
  16. +1 1  src/NLog.netfx35.sln
  17. +1 1  src/NLog.netfx40.sln
  18. +37 13 src/NLog.proj
  19. +14 1 src/NLog/LogEventInfo.cs
  20. +6 1 src/NLog/NLog.mono2.csproj
  21. +6 1 src/NLog/NLog.netcf20.csproj
  22. +7 4 src/NLog/NLog.netcf35.csproj
  23. +6 1 src/NLog/NLog.netfx20.csproj
  24. +6 1 src/NLog/NLog.netfx35.csproj
  25. +6 1 src/NLog/NLog.netfx40.csproj
  26. +6 1 src/NLog/NLog.sl2.csproj
  27. +6 1 src/NLog/NLog.sl3.csproj
  28. +6 1 src/NLog/NLog.sl4.csproj
  29. +6 1 src/NLog/NLog.wp7.csproj
  30. +6 1 src/NLog/NLog.wp71.csproj
  31. +0 1  src/NLog/Properties/AssemblyInfo.cs
  32. +19 1 tests/NLog.UnitTests/LoggerTests.cs
  33. +20 2 tests/NLog.UnitTests/SourceCodeTests.cs
  34. +1 1  tests/NLog.UnitTests/Targets/NetworkTargetTests.cs
  35. +1 1  tests/NLog.UnitTests/Targets/Wrappers/BufferingTargetWrapperTests.cs
  36. +47 13 tools/DumpTestResultSummary/Program.cs
  37. +1 2  {tests → tools}/SilverlightConsoleRunner/ConsoleRunner.cs
  38. 0  {tests → tools}/SilverlightConsoleRunner/MicroHttpServer.cs
  39. 0  {tests → tools}/SilverlightConsoleRunner/Program.cs
  40. 0  {tests → tools}/SilverlightConsoleRunner/Properties/AssemblyInfo.cs
  41. 0  {tests → tools}/SilverlightConsoleRunner/RunnerForm.Designer.cs
  42. 0  {tests → tools}/SilverlightConsoleRunner/RunnerForm.cs
  43. 0  {tests → tools}/SilverlightConsoleRunner/RunnerForm.resx
  44. 0  {tests → tools}/SilverlightConsoleRunner/Silverlight2.js
  45. 0  {tests → tools}/SilverlightConsoleRunner/Silverlight3.js
  46. 0  {tests → tools}/SilverlightConsoleRunner/Silverlight4.js
  47. 0  {tests → tools}/SilverlightConsoleRunner/SilverlightConsoleRunner.csproj
  48. 0  {tests → tools}/SilverlightConsoleRunner/SilverlightConsoleRunner.sln
  49. 0  {tests → tools}/SilverlightConsoleRunner/XapHost2.html
  50. 0  {tests → tools}/SilverlightConsoleRunner/XapHost3.html
  51. 0  {tests → tools}/SilverlightConsoleRunner/XapHost4.html
9 Makefile
@@ -55,6 +55,15 @@ mergeapitool:
55 55 builddocpagestool:
56 56 $(XBUILD) tools/BuildDocPages/BuildDocPages.csproj /p:Configuration=$(CONFIG)
57 57
  58 +syncprojectitemstool:
  59 + $(XBUILD) tools/SyncProjectItems/SyncProjectItems.csproj /p:Configuration=$(CONFIG)
  60 +
  61 +syncprojectitems: syncprojectitemstool
  62 + (cd src/NLog && mono ../../build/bin/Tools/SyncProjectItems.exe ProjectFileInfo.xml)
  63 + (cd src/NLog.Extended && mono ../../build/bin/Tools/SyncProjectItems.exe ProjectFileInfo.xml)
  64 + (cd tests/NLog.UnitTests && mono ../../build/bin/Tools/SyncProjectItems.exe ProjectFileInfo.xml)
  65 + (cd tests/SampleExtensions && mono ../../build/bin/Tools/SyncProjectItems.exe ProjectFileInfo.xml)
  66 +
58 67 dumpapi: dumpapitool mergeapitool buildnlog
59 68 (cd $(OUTPUT_DIR) && mono ../../Tools/DumpApiXml.exe -comments NLog.xml -assembly NLog.dll -assembly NLog.Extended.dll -ref $(MONO_LIB_DIR) -output API/NLog.api)
60 69 (mono build/bin/Tools/MergeApiXml.exe "build/bin/$(CONFIG)")
16 build.cmd
@@ -201,6 +201,20 @@ if (%1)==(label) (
201 201 goto next
202 202 )
203 203
  204 +if (%1)==(ccnetlabel) (
  205 + set MSBUILD_ARGUMENTS=%MSBUILD_ARGUMENTS% /p:CCNetLabel=%2
  206 + shift
  207 + shift
  208 + goto next
  209 +)
  210 +
  211 +if (%1)==(buildpath) (
  212 + set MSBUILD_ARGUMENTS=%MSBUILD_ARGUMENTS% /p:BaseOutputDirectory=%2
  213 + shift
  214 + shift
  215 + goto next
  216 +)
  217 +
204 218 if (%1)==(websitedir) (
205 219 set MSBUILD_ARGUMENTS=%MSBUILD_ARGUMENTS% /p:WebsiteDir=%2
206 220 shift
@@ -266,6 +280,8 @@ echo xsd NLog.xsd Intellisense files
266 280 echo installer Installer
267 281 echo tools Tools
268 282 echo label {suffix} Define build label (defaults to 'PrivateBuild')
  283 +echo ccnetlabel {label} Override CCNetLabel
  284 +echo buildpath {dir} Set build directory.
269 285 exit /b 1
270 286
271 287 :build
5 .../InstallNLogConfig/InstallNLogConfig.mono2.csproj → src/InstallNLogConfig/InstallNLogConfig.mono2.csproj
@@ -49,4 +49,9 @@
49 49 </ProjectReference>
50 50 </ItemGroup>
51 51 <Import Project="..\..\src\Mono.targets" />
  52 + <Target Name="BeforeBuild">
  53 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  54 + <Compile Include="$(BuildInfoFile)" />
  55 + </ItemGroup>
  56 + </Target>
52 57 </Project>
5 ...nstallNLogConfig/InstallNLogConfig.netfx20.csproj → ...nstallNLogConfig/InstallNLogConfig.netfx20.csproj
@@ -59,4 +59,9 @@
59 59 <Target Name="AfterBuild">
60 60 </Target>
61 61 -->
  62 + <Target Name="BeforeBuild">
  63 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  64 + <Compile Include="$(BuildInfoFile)" />
  65 + </ItemGroup>
  66 + </Target>
62 67 </Project>
5 ...nstallNLogConfig/InstallNLogConfig.netfx35.csproj → ...nstallNLogConfig/InstallNLogConfig.netfx35.csproj
@@ -101,4 +101,9 @@
101 101 <Target Name="AfterBuild">
102 102 </Target>
103 103 -->
  104 + <Target Name="BeforeBuild">
  105 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  106 + <Compile Include="$(BuildInfoFile)" />
  107 + </ItemGroup>
  108 + </Target>
104 109 </Project>
5 ...nstallNLogConfig/InstallNLogConfig.netfx40.csproj → ...nstallNLogConfig/InstallNLogConfig.netfx40.csproj
@@ -63,4 +63,9 @@
63 63 <Target Name="AfterBuild">
64 64 </Target>
65 65 -->
  66 + <Target Name="BeforeBuild">
  67 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  68 + <Compile Include="$(BuildInfoFile)" />
  69 + </ItemGroup>
  70 + </Target>
66 71 </Project>
0  tools/InstallNLogConfig/Program.cs → src/InstallNLogConfig/Program.cs
File renamed without changes
1  tools/InstallNLogConfig/Properties/AssemblyInfo.cs → src/InstallNLogConfig/Properties/AssemblyInfo.cs
@@ -63,7 +63,6 @@
63 63 [assembly: AssemblyDescription("NLog configuration installer")]
64 64 [assembly: AssemblyConfiguration("")]
65 65 [assembly: AssemblyCompany("NLog")]
66   -[assembly: AssemblyProduct("NLog - Advanced .NET Logging")]
67 66 [assembly: AssemblyCopyright("Copyright (c) 2004-2010 by Jaroslaw Kowalski")]
68 67 [assembly: AssemblyCulture("")]
69 68
7 src/NLog.Extended/NLog.Extended.mono2.csproj
@@ -81,4 +81,9 @@
81 81 </ProjectReference>
82 82 </ItemGroup>
83 83 <Import Project="..\Mono.targets" />
84   -</Project>
  84 + <Target Name="BeforeBuild">
  85 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  86 + <Compile Include="$(BuildInfoFile)" />
  87 + </ItemGroup>
  88 + </Target>
  89 +</Project>
5 src/NLog.Extended/NLog.Extended.monodevelop.csproj
@@ -83,4 +83,9 @@
83 83 <Name>NLog.monodevelop</Name>
84 84 </ProjectReference>
85 85 </ItemGroup>
  86 + <Target Name="BeforeBuild">
  87 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  88 + <Compile Include="$(BuildInfoFile)" />
  89 + </ItemGroup>
  90 + </Target>
86 91 </Project>
7 src/NLog.Extended/NLog.Extended.netfx20.csproj
@@ -79,4 +79,9 @@
79 79 <Target Name="AfterBuild">
80 80 </Target>
81 81 -->
82   -</Project>
  82 + <Target Name="BeforeBuild">
  83 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  84 + <Compile Include="$(BuildInfoFile)" />
  85 + </ItemGroup>
  86 + </Target>
  87 +</Project>
7 src/NLog.Extended/NLog.Extended.netfx35.csproj
@@ -88,4 +88,9 @@
88 88 <Target Name="AfterBuild">
89 89 </Target>
90 90 -->
91   -</Project>
  91 + <Target Name="BeforeBuild">
  92 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  93 + <Compile Include="$(BuildInfoFile)" />
  94 + </ItemGroup>
  95 + </Target>
  96 +</Project>
7 src/NLog.Extended/NLog.Extended.netfx40.csproj
@@ -91,4 +91,9 @@
91 91 <Target Name="AfterBuild">
92 92 </Target>
93 93 -->
94   -</Project>
  94 + <Target Name="BeforeBuild">
  95 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  96 + <Compile Include="$(BuildInfoFile)" />
  97 + </ItemGroup>
  98 + </Target>
  99 +</Project>
1  src/NLog.Extended/Properties/AssemblyInfo.cs
@@ -53,7 +53,6 @@
53 53 [assembly: AssemblyDescription("NLog")]
54 54 [assembly: AssemblyConfiguration("")]
55 55 [assembly: AssemblyCompany("NLog")]
56   -[assembly: AssemblyProduct("NLog - Advanced .NET Logging")]
57 56 [assembly: AssemblyCopyright("Copyright (c) 2004-2010 by Jaroslaw Kowalski")]
58 57 [assembly: AssemblyCulture("")]
59 58
2  src/NLog.netfx20.sln
@@ -12,7 +12,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.UnitTests.netfx20", ".
12 12 EndProject
13 13 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtensions.netfx20", "..\tests\SampleExtensions\SampleExtensions.netfx20.csproj", "{1653EE05-2720-4A85-BF14-74C4593787B1}"
14 14 EndProject
15   -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallNLogConfig.netfx20", "..\tools\InstallNLogConfig\InstallNLogConfig.netfx20.csproj", "{0CF95BE4-0546-4CE9-AB49-B9E5DA599EAA}"
  15 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallNLogConfig.netfx20", "InstallNLogConfig\InstallNLogConfig.netfx20.csproj", "{0CF95BE4-0546-4CE9-AB49-B9E5DA599EAA}"
16 16 EndProject
17 17 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.Extended.netfx20", "NLog.Extended\NLog.Extended.netfx20.csproj", "{F801A1F9-1024-4446-BF9E-A923137340B8}"
18 18 EndProject
2  src/NLog.netfx35.sln
@@ -16,7 +16,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.BinaryCompatTests.netf
16 16 EndProject
17 17 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtensions.netfx35", "..\tests\SampleExtensions\SampleExtensions.netfx35.csproj", "{A8CA32F1-BD4C-4A99-B307-99A93DB64B9F}"
18 18 EndProject
19   -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallNLogConfig.netfx35", "..\tools\InstallNLogConfig\InstallNLogConfig.netfx35.csproj", "{0CF95BE4-0546-4CE9-AB49-B9E4DA59AEAA}"
  19 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallNLogConfig.netfx35", "InstallNLogConfig\InstallNLogConfig.netfx35.csproj", "{0CF95BE4-0546-4CE9-AB49-B9E4DA59AEAA}"
20 20 EndProject
21 21 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.Extended.netfx35", "NLog.Extended\NLog.Extended.netfx35.csproj", "{F801A1F9-1024-4446-BF9E-A923137340B8}"
22 22 EndProject
2  src/NLog.netfx40.sln
@@ -12,7 +12,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.UnitTests.netfx40", ".
12 12 EndProject
13 13 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtensions.netfx40", "..\tests\SampleExtensions\SampleExtensions.netfx40.csproj", "{FE067913-E9A8-41F0-89FA-C1136F8FB6A8}"
14 14 EndProject
15   -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallNLogConfig.netfx40", "..\tools\InstallNLogConfig\InstallNLogConfig.netfx40.csproj", "{0CF95BE4-0546-4CE9-AB49-B9E4DA599EAA}"
  15 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallNLogConfig.netfx40", "InstallNLogConfig\InstallNLogConfig.netfx40.csproj", "{0CF95BE4-0546-4CE9-AB49-B9E4DA599EAA}"
16 16 EndProject
17 17 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.Extended.netfx40", "NLog.Extended\NLog.Extended.netfx40.csproj", "{A961A1F9-1024-4446-BF9E-A923137340B8}"
18 18 EndProject
50 src/NLog.proj
@@ -2,13 +2,18 @@
2 2 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
3 3
4 4 <PropertyGroup>
  5 + <MajorMinorVersion>2.0</MajorMinorVersion>
  6 + <BuildLabel Condition=" '$(BuildLabel)'=='' ">PrivateBuild</BuildLabel>
  7 + <BuildLabel Condition=" '$(CCNetLabel)'!='' ">$(CCNetLabel)</BuildLabel>
  8 + <BuildVersion>2.0.0.0</BuildVersion>
  9 + <BuildProductName>NLog v$(MajorMinorVersion) ($(BuildLabel))</BuildProductName>
  10 + </PropertyGroup>
  11 +
  12 + <PropertyGroup>
5 13 <Configuration Condition="'$(Configuration)'==''">Debug</Configuration>
6 14 <BaseOutputDirectory>$(MSBuildProjectDirectory)\..\build\</BaseOutputDirectory>
7 15 <ProjectTarget Condition="'$(ProjectTarget)'==''">Build</ProjectTarget>
8 16 <FrameworksPath>$(MSBuildProjectDirectory)\Frameworks</FrameworksPath>
9   - <BuildLabel>PrivateBuild</BuildLabel>
10   - <BuildLabel Condition=" '$(CCNetLabel)'!='' ">$(CCNetLabel)</BuildLabel>
11   - <BuildVersion>0.0.0.0</BuildVersion>
12 17 <BuildAllFrameworks>true</BuildAllFrameworks>
13 18 <BuildAllFrameworks Condition="'$(BuildMono2)' == 'true'">false</BuildAllFrameworks>
14 19 <BuildAllFrameworks Condition="'$(BuildSL2)' == 'true'">false</BuildAllFrameworks>
@@ -22,8 +27,7 @@
22 27 <BuildAllFrameworks Condition="'$(BuildNetCF20)' == 'true'">false</BuildAllFrameworks>
23 28 <BuildAllFrameworks Condition="'$(BuildNetCF35)' == 'true'">false</BuildAllFrameworks>
24 29 <ToolsDir>$(MSBuildProjectDirectory)\..\build\bin\Tools</ToolsDir>
25   - <SLTestRunner>$(MSBuildProjectDirectory)\..\build\bin\Tools\SilverlightConsoleRunner.exe</SLTestRunner>
26   - <DumpTestResultSummary>$(ToolsDir)\DumpTestResultSummary.exe</DumpTestResultSummary>
  30 + <SLTestRunner>$(BaseOutputDirectory)\bin\Tools\SilverlightConsoleRunner.exe</SLTestRunner>
27 31 <DeployNetCF>..\tools\DeployNetCF.exe</DeployNetCF>
28 32 <DumpApiXml>$(ToolsDir)\DumpApiXml.exe</DumpApiXml>
29 33 <MergeApiXml>$(ToolsDir)\MergeApiXml.exe</MergeApiXml>
@@ -39,6 +43,7 @@
39 43 <ConfigurationSuffix Condition="'$(Configuration)' == 'Debug'">-debug</ConfigurationSuffix>
40 44 <WebsiteDir Condition="'$(WebsiteDir)' == ''">$(BaseOutputDirectory)\bin\$(Configuration)\Website</WebsiteDir>
41 45 <LastTestRunSummary>$(BaseOutputDirectory)\bin\LastTestRunSummary.cmd</LastTestRunSummary>
  46 + <BuildInfoFile>$(BaseOutputDirectory)\obj\BuildInfo.cs</BuildInfoFile>
42 47 </PropertyGroup>
43 48
44 49 <!-- detect location of various SDKs and tools-->
@@ -189,26 +194,43 @@
189 194 </Target>
190 195
191 196 <Target Name="Build">
  197 + <PropertyGroup>
  198 + <BuildInfoFileContent>
  199 +// automatically generated
  200 +[assembly: System.Reflection.AssemblyProduct("$(BuildProductName)")]
  201 +</BuildInfoFileContent>
  202 + </PropertyGroup>
  203 +
  204 + <MakeDir Directories="$(BaseOutputDirectory)\obj" />
  205 +
  206 + <ReadLinesFromFile File="$(BuildInfoFile)" Condition="Exists('$(BuildInfoFile)')">
  207 + <Output TaskParameter="Lines" ItemName="CurrentBuildInfoFileContent" />
  208 + </ReadLinesFromFile>
  209 +
  210 + <WriteLinesToFile File="$(BuildInfoFile)"
  211 + Lines='$(BuildInfoFileContent)'
  212 + Overwrite="true"
  213 + Condition="'$(BuildInfoFileContent)' != '@(CurrentBuildInfoFileContent)' " />
192 214 <MSBuild Projects="NLog\NLog%(TargetFramework.ProjectFileSuffix).csproj"
193 215 Targets="Build"
194   - Properties="$(StyleCopProperties);%(TargetFramework.Properties);BaseOutputDirectory=$(BaseOutputDirectory)"
  216 + Properties="$(StyleCopProperties);%(TargetFramework.Properties);BaseOutputDirectory=$(BaseOutputDirectory);BuildInfoFile=$(BuildInfoFile)"
195 217 ToolsVersion="%(TargetFramework.ToolsVersion)"
196 218 ContinueOnError="$(BuildAllFrameworks)"
197 219 StopOnFirstFailure="false" />
198 220 <MSBuild Projects="NLog.Extended\NLog.Extended%(TargetFramework.ProjectFileSuffix).csproj"
199 221 Targets="Build"
200   - Properties="$(StyleCopProperties);%(TargetFramework.Properties);BaseOutputDirectory=$(BaseOutputDirectory)"
  222 + Properties="$(StyleCopProperties);%(TargetFramework.Properties);BaseOutputDirectory=$(BaseOutputDirectory);BuildInfoFile=$(BuildInfoFile)"
201 223 ToolsVersion="%(TargetFramework.ToolsVersion)"
202 224 ContinueOnError="$(BuildAllFrameworks)"
203 225 StopOnFirstFailure="false"
204 226 Condition="Exists('NLog.Extended\NLog.Extended%(TargetFramework.ProjectFileSuffix).csproj')" />
205   - <MSBuild Projects="..\tools\InstallNLogConfig\InstallNLogConfig%(TargetFramework.ProjectFileSuffix).csproj"
  227 + <MSBuild Projects="InstallNLogConfig\InstallNLogConfig%(TargetFramework.ProjectFileSuffix).csproj"
206 228 Targets="Build"
207   - Properties="$(StyleCopProperties);%(TargetFramework.Properties);BaseOutputDirectory=$(BaseOutputDirectory)"
  229 + Properties="$(StyleCopProperties);%(TargetFramework.Properties);BaseOutputDirectory=$(BaseOutputDirectory);BuildInfoFile=$(BuildInfoFile)"
208 230 ToolsVersion="%(TargetFramework.ToolsVersion)"
209 231 ContinueOnError="$(BuildAllFrameworks)"
210 232 StopOnFirstFailure="false"
211   - Condition="Exists('..\tools\InstallNLogConfig\InstallNLogConfig%(TargetFramework.ProjectFileSuffix).csproj')" />
  233 + Condition="Exists('InstallNLogConfig\InstallNLogConfig%(TargetFramework.ProjectFileSuffix).csproj')" />
212 234
213 235 <CallTarget Targets="BuildNLogC" />
214 236 </Target>
@@ -339,11 +361,13 @@
339 361 </Target>
340 362
341 363 <Target Name="WP7Test">
  364 + <Exec Command="TaskKill /f /im XDE.exe 2&gt; nul" IgnoreExitCode="true" />
342 365 <Exec Command='"$(SLTestRunner)" NLog.UnitTests.xap WP7 -guid 3cf9fab9-588c-49c8-8a45-ef071442304f -icon ApplicationIcon.png'
343 366 WorkingDirectory="$(BaseOutputDirectory)\bin\$(Configuration)\Silverlight for Windows Phone 7" IgnoreExitCode="true" />
344 367 </Target>
345 368
346 369 <Target Name="WP71Test">
  370 + <Exec Command="TaskKill /f /im XDE.exe 2&gt; nul" IgnoreExitCode="true" />
347 371 <Exec Command='"$(SLTestRunner)" NLog.UnitTests.xap WP71 -guid 3cf9fab9-588c-49c8-8a45-ef071442304f -icon ApplicationIcon.png'
348 372 WorkingDirectory="$(BaseOutputDirectory)\bin\$(Configuration)\Silverlight for Windows Phone 7.1" IgnoreExitCode="true" />
349 373 </Target>
@@ -367,7 +391,7 @@
367 391 <WriteLinesToFile File="$(LastTestRunSummary)" Lines='echo ---------------------' />
368 392 <WriteLinesToFile File="$(LastTestRunSummary)" Lines='echo Test run summary:' />
369 393 <WriteLinesToFile File="$(LastTestRunSummary)" Lines='echo ---------------------' />
370   - <WriteLinesToFile File="$(LastTestRunSummary)" Lines='"$(DumpTestResultSummary)" "%(TargetFramework.Identity)" "%~dp0$(Configuration)\%(TargetFramework.Identity)\TestResults.trx" %*' />
  394 + <WriteLinesToFile File="$(LastTestRunSummary)" Lines='%~dp0Tools\DumpTestResultSummary.exe all %~dp0$(Configuration) %*' />
371 395 </Target>
372 396
373 397 <Target Name="BuildMergedDocumentation">
@@ -426,7 +450,7 @@
426 450 </Target>
427 451
428 452 <Target Name="BuildSLTestRunner">
429   - <MSBuild Projects="..\tests\SilverlightConsoleRunner\SilverlightConsoleRunner.csproj" />
  453 + <MSBuild Projects="..\tools\SilverlightConsoleRunner\SilverlightConsoleRunner.csproj" />
430 454 </Target>
431 455
432 456 <Target Name="BuildTestResultSummaryTool">
@@ -535,7 +559,7 @@
535 559 <ProjectsToCleanup Include="..\tests\NLog.UnitTests.Web" />
536 560 <ProjectsToCleanup Include="..\tests\NLog.VBTest" />
537 561 <ProjectsToCleanup Include="..\tests\NLogC.Tests" />
538   - <ProjectsToCleanup Include="..\tests\SilverlightConsoleRunner" />
  562 + <ProjectsToCleanup Include="..\tools\SilverlightConsoleRunner" />
539 563 <ProjectsToCleanup Include="..\tools\MakeNLogXSD" />
540 564 <ProjectsToCleanup Include="..\tools\DeployNetCF" />
541 565 <ProjectsToCleanup Include="..\tools\DumpTestResultSummary" />
15 src/NLog/LogEventInfo.cs
@@ -431,7 +431,20 @@ private void CalcFormattedMessage()
431 431 }
432 432 else
433 433 {
434   - this.formattedMessage = string.Format(this.FormatProvider ?? CultureInfo.CurrentCulture, this.Message, this.Parameters);
  434 + try
  435 + {
  436 + this.formattedMessage = string.Format(this.FormatProvider ?? CultureInfo.CurrentCulture, this.Message, this.Parameters);
  437 + }
  438 + catch (Exception exception)
  439 + {
  440 + this.formattedMessage = this.Message;
  441 + if (exception.MustBeRethrown())
  442 + {
  443 + throw;
  444 + }
  445 +
  446 + InternalLogger.Warn("Error when formatting a message: {0}", exception);
  447 + }
435 448 }
436 449 }
437 450
7 src/NLog/NLog.mono2.csproj
@@ -369,4 +369,9 @@
369 369 <CodeAnalysisDictionary Include="CustomDictionary.xml" />
370 370 </ItemGroup>
371 371 <Import Project="..\Mono.targets" />
372   -</Project>
  372 + <Target Name="BeforeBuild">
  373 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  374 + <Compile Include="$(BuildInfoFile)" />
  375 + </ItemGroup>
  376 + </Target>
  377 +</Project>
7 src/NLog/NLog.netcf20.csproj
@@ -382,4 +382,9 @@
382 382 </FlavorProperties>
383 383 </VisualStudio>
384 384 </ProjectExtensions>
385   -</Project>
  385 + <Target Name="BeforeBuild">
  386 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  387 + <Compile Include="$(BuildInfoFile)" />
  388 + </ItemGroup>
  389 + </Target>
  390 +</Project>
11 src/NLog/NLog.netcf35.csproj
@@ -294,9 +294,7 @@
294 294 <Compile Include="LogReceiverService\LogReceiverServiceConfig.cs" />
295 295 <Compile Include="LogReceiverService\NLogEvent.cs" />
296 296 <Compile Include="LogReceiverService\NLogEvents.cs" />
297   - <Compile Include="LogReceiverService\SoapLogReceiverClient.cs">
298   - <SubType>Component</SubType>
299   - </Compile>
  297 + <Compile Include="LogReceiverService\SoapLogReceiverClient.cs" />
300 298 <Compile Include="LogReceiverService\StringCollection.cs" />
301 299 <Compile Include="LogReceiverService\WcfLogReceiverClient.cs" />
302 300 <Compile Include="MappedDiagnosticsContext.cs" />
@@ -386,4 +384,9 @@
386 384 </FlavorProperties>
387 385 </VisualStudio>
388 386 </ProjectExtensions>
389   -</Project>
  387 + <Target Name="BeforeBuild">
  388 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  389 + <Compile Include="$(BuildInfoFile)" />
  390 + </ItemGroup>
  391 + </Target>
  392 +</Project>
7 src/NLog/NLog.netfx20.csproj
@@ -366,4 +366,9 @@
366 366 </ItemGroup>
367 367 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
368 368 <Import Project="$(StyleCopTargetsFile)" Condition="'$(StyleCopTargetsFile)' != ''" />
369   -</Project>
  369 + <Target Name="BeforeBuild">
  370 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  371 + <Compile Include="$(BuildInfoFile)" />
  372 + </ItemGroup>
  373 + </Target>
  374 +</Project>
7 src/NLog/NLog.netfx35.csproj
@@ -368,4 +368,9 @@
368 368 </ItemGroup>
369 369 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
370 370 <Import Project="$(StyleCopTargetsFile)" Condition="'$(StyleCopTargetsFile)' != ''" />
371   -</Project>
  371 + <Target Name="BeforeBuild">
  372 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  373 + <Compile Include="$(BuildInfoFile)" />
  374 + </ItemGroup>
  375 + </Target>
  376 +</Project>
7 src/NLog/NLog.netfx40.csproj
@@ -372,4 +372,9 @@
372 372 </ItemGroup>
373 373 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
374 374 <Import Project="$(StyleCopTargetsFile)" Condition="Exists('$(StyleCopTargetsFile)')" />
375   -</Project>
  375 + <Target Name="BeforeBuild">
  376 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  377 + <Compile Include="$(BuildInfoFile)" />
  378 + </ItemGroup>
  379 + </Target>
  380 +</Project>
7 src/NLog/NLog.sl2.csproj
@@ -374,4 +374,9 @@
374 374 </FlavorProperties>
375 375 </VisualStudio>
376 376 </ProjectExtensions>
377   -</Project>
  377 + <Target Name="BeforeBuild">
  378 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  379 + <Compile Include="$(BuildInfoFile)" />
  380 + </ItemGroup>
  381 + </Target>
  382 +</Project>
7 src/NLog/NLog.sl3.csproj
@@ -374,4 +374,9 @@
374 374 </FlavorProperties>
375 375 </VisualStudio>
376 376 </ProjectExtensions>
377   -</Project>
  377 + <Target Name="BeforeBuild">
  378 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  379 + <Compile Include="$(BuildInfoFile)" />
  380 + </ItemGroup>
  381 + </Target>
  382 +</Project>
7 src/NLog/NLog.sl4.csproj
@@ -375,4 +375,9 @@
375 375 </FlavorProperties>
376 376 </VisualStudio>
377 377 </ProjectExtensions>
378   -</Project>
  378 + <Target Name="BeforeBuild">
  379 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  380 + <Compile Include="$(BuildInfoFile)" />
  381 + </ItemGroup>
  382 + </Target>
  383 +</Project>
7 src/NLog/NLog.wp7.csproj
@@ -376,4 +376,9 @@
376 376 <Target Name="AfterBuild">
377 377 </Target>
378 378 -->
379   -</Project>
  379 + <Target Name="BeforeBuild">
  380 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  381 + <Compile Include="$(BuildInfoFile)" />
  382 + </ItemGroup>
  383 + </Target>
  384 +</Project>
7 src/NLog/NLog.wp71.csproj
@@ -369,6 +369,11 @@
369 369 <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
370 370 <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" />
371 371 <ProjectExtensions />
  372 + <Target Name="BeforeBuild">
  373 + <ItemGroup Condition="Exists('$(BuildInfoFile)')">
  374 + <Compile Include="$(BuildInfoFile)" />
  375 + </ItemGroup>
  376 + </Target>
372 377 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
373 378 Other similar extension points exist, see Microsoft.Common.targets.
374 379 <Target Name="BeforeBuild">
@@ -376,4 +381,4 @@
376 381 <Target Name="AfterBuild">
377 382 </Target>
378 383 -->
379   -</Project>
  384 +</Project>
1  src/NLog/Properties/AssemblyInfo.cs
@@ -67,7 +67,6 @@
67 67 [assembly: AssemblyDescription("NLog")]
68 68 [assembly: AssemblyConfiguration("")]
69 69 [assembly: AssemblyCompany("NLog")]
70   -[assembly: AssemblyProduct("NLog - Advanced .NET Logging")]
71 70 [assembly: AssemblyCopyright("Copyright (c) 2004-2010 by Jaroslaw Kowalski")]
72 71 [assembly: AssemblyCulture("")]
73 72
20 tests/NLog.UnitTests/LoggerTests.cs
@@ -1181,10 +1181,28 @@ public void LogTest()
1181 1181 }
1182 1182 }
1183 1183
  1184 + [Test]
  1185 + public void StringFormatWillNotCauseExceptions()
  1186 + {
  1187 + LogManager.Configuration = CreateConfigurationFromString(@"
  1188 + <nlog throwExceptions='true'>
  1189 + <targets><target name='debug' type='Debug' layout='${message}' /></targets>
  1190 + <rules>
  1191 + <logger name='*' minLevel='Info' writeTo='debug' />
  1192 + </rules>
  1193 + </nlog>");
  1194 +
  1195 + Logger l = LogManager.GetLogger("StringFormatWillNotCauseExceptions");
  1196 +
  1197 + // invalid format string
  1198 + l.Info("aaaa {0");
  1199 + AssertDebugLastMessage("debug", "aaaa {0");
  1200 + }
  1201 +
1184 1202 public override string ToString()
1185 1203 {
1186 1204 return "object-to-string";
1187 1205 }
1188 1206
1189 1207 }
1190   -}
  1208 +}
22 tests/NLog.UnitTests/SourceCodeTests.cs
@@ -84,7 +84,7 @@ public class SourceCodeTests
84 84 public void Initialize()
85 85 {
86 86 this.sourceCodeDirectory = Directory.GetCurrentDirectory();
87   - while (true)
  87 + while (this.sourceCodeDirectory != null)
88 88 {
89 89 this.licenseFile = Path.Combine(sourceCodeDirectory, "LICENSE.txt");
90 90 if (File.Exists(licenseFile))
@@ -95,12 +95,20 @@ public void Initialize()
95 95 this.sourceCodeDirectory = Path.GetDirectoryName(this.sourceCodeDirectory);
96 96 }
97 97
98   - this.licenseLines = File.ReadAllLines(this.licenseFile);
  98 + if (this.sourceCodeDirectory != null)
  99 + {
  100 + this.licenseLines = File.ReadAllLines(this.licenseFile);
  101 + }
99 102 }
100 103
101 104 [Test]
102 105 public void VerifyFileHeaders()
103 106 {
  107 + if (this.sourceCodeDirectory == null)
  108 + {
  109 + return;
  110 + }
  111 +
104 112 int failedFiles = 0;
105 113
106 114 foreach (string dir in directoriesToVerify)
@@ -129,6 +137,11 @@ public void VerifyFileHeaders()
129 137 [Test]
130 138 public void VerifyProjectsInSync()
131 139 {
  140 + if (this.sourceCodeDirectory == null)
  141 + {
  142 + return;
  143 + }
  144 +
132 145 int failures = 0;
133 146 var filesToCompile = new List<string>();
134 147
@@ -231,6 +244,11 @@ private static void GetAllFilesToCompileInDirectory(List<string> output, string
231 244 [Test]
232 245 public void VerifyNamespacesAndClassNames()
233 246 {
  247 + if (this.sourceCodeDirectory == null)
  248 + {
  249 + return;
  250 + }
  251 +
234 252 int failedFiles = 0;
235 253
236 254 foreach (string dir in directoriesToVerify)
2  tests/NLog.UnitTests/Targets/NetworkTargetTests.cs
@@ -31,7 +31,7 @@
31 31 // THE POSSIBILITY OF SUCH DAMAGE.
32 32 //
33 33
34   -#if !WINDOWS_PHONE
  34 +#if !WINDOWS_PHONE_7
35 35
36 36 namespace NLog.UnitTests.Targets
37 37 {
2  tests/NLog.UnitTests/Targets/Wrappers/BufferingTargetWrapperTests.cs
@@ -207,7 +207,7 @@ public void BufferingTargetWrapperSyncWithTimedFlushTest()
207 207 Assert.AreEqual(0, myTarget.WriteCount);
208 208
209 209 // sleep 2 seconds, this will trigger the timer and flush all events
210   - Thread.Sleep(2000);
  210 + Thread.Sleep(4000);
211 211 Assert.AreEqual(9, hitCount);
212 212 Assert.AreEqual(1, myTarget.BufferedWriteCount);
213 213 Assert.AreEqual(9, myTarget.BufferedTotalEvents);
60 tools/DumpTestResultSummary/Program.cs
@@ -52,15 +52,8 @@ static int Main(string[] args)
52 52 return 1;
53 53 }
54 54
  55 + string label = args[0];
55 56 string trxFileName = args[1];
56   - if (!File.Exists(trxFileName))
57   - {
58   - Console.Write(args[0].PadRight(35));
59   - Console.ForegroundColor = ConsoleColor.Red;
60   - Console.WriteLine("TRX file not found!");
61   - return 0;
62   - }
63   -
64 57 if (args.Length >= 3)
65 58 {
66 59 if (!Enum.TryParse(args[2], true, out mode))
@@ -70,11 +63,14 @@ static int Main(string[] args)
70 63 }
71 64 }
72 65
73   - XElement element = XElement.Load(trxFileName);
74   - var analyzer = new MSTestResultsFileAnalyzer(element.Name.Namespace);
75   - analyzer.Label = args[0];
76   - analyzer.Mode = mode;
77   - analyzer.DumpSummary(element);
  66 + if (label == "all")
  67 + {
  68 + ProcessDirectory(trxFileName, mode);
  69 + }
  70 + else
  71 + {
  72 + ProcessSingleTrxFile(trxFileName, label, mode);
  73 + }
78 74
79 75 return 0;
80 76 }
@@ -90,6 +86,44 @@ static int Main(string[] args)
90 86 }
91 87 }
92 88
  89 + private static void ProcessDirectory(string parentDirectory, AnalysisMode mode)
  90 + {
  91 + foreach (string subDir in Directory.GetDirectories(parentDirectory))
  92 + {
  93 + if (Directory.GetFiles(subDir, "*.UnitTests.dll").Length > 0)
  94 + {
  95 + string trxFile = Path.Combine(subDir, "TestResults.trx");
  96 + ProcessSingleTrxFile(trxFile, Path.GetFileName(subDir), mode);
  97 + }
  98 + }
  99 + }
  100 +
  101 + private static void ProcessSingleTrxFile(string trxFileName, string label, AnalysisMode mode)
  102 + {
  103 + var oldColor = Console.ForegroundColor;
  104 + try
  105 + {
  106 + if (!File.Exists(trxFileName))
  107 + {
  108 + Console.Write(label.PadRight(35));
  109 + Console.ForegroundColor = ConsoleColor.Red;
  110 + Console.WriteLine("TRX file not found!");
  111 + }
  112 + else
  113 + {
  114 + XElement element = XElement.Load(trxFileName);
  115 + var analyzer = new MSTestResultsFileAnalyzer(element.Name.Namespace);
  116 + analyzer.Label = label;
  117 + analyzer.Mode = mode;
  118 + analyzer.DumpSummary(element);
  119 + }
  120 + }
  121 + finally
  122 + {
  123 + Console.ForegroundColor = oldColor;
  124 + }
  125 + }
  126 +
93 127 private static void Usage()
94 128 {
95 129 Console.WriteLine("Usage: DumpTestResultSummary label filename.trx [summary|detailed]");
3  tests/SilverlightConsoleRunner/ConsoleRunner.cs → tools/SilverlightConsoleRunner/ConsoleRunner.cs
@@ -115,8 +115,7 @@ public void Run()
115 115
116 116 private void ResetTimer()
117 117 {
118   - // 90 second timeout
119   - this.timer.Change(90000, Timeout.Infinite);
  118 + this.timer.Change(180000, Timeout.Infinite);
120 119 }
121 120
122 121 private void OnTestMethodCompleted(HttpListenerContext context)
0  tests/SilverlightConsoleRunner/MicroHttpServer.cs → tools/SilverlightConsoleRunner/MicroHttpServer.cs
File renamed without changes
0  tests/SilverlightConsoleRunner/Program.cs → tools/SilverlightConsoleRunner/Program.cs
File renamed without changes
0  ...lverlightConsoleRunner/Properties/AssemblyInfo.cs → ...lverlightConsoleRunner/Properties/AssemblyInfo.cs
File renamed without changes
0  ...s/SilverlightConsoleRunner/RunnerForm.Designer.cs → ...s/SilverlightConsoleRunner/RunnerForm.Designer.cs
File renamed without changes
0  tests/SilverlightConsoleRunner/RunnerForm.cs → tools/SilverlightConsoleRunner/RunnerForm.cs
File renamed without changes
0  tests/SilverlightConsoleRunner/RunnerForm.resx → tools/SilverlightConsoleRunner/RunnerForm.resx
File renamed without changes
0  tests/SilverlightConsoleRunner/Silverlight2.js → tools/SilverlightConsoleRunner/Silverlight2.js
File renamed without changes
0  tests/SilverlightConsoleRunner/Silverlight3.js → tools/SilverlightConsoleRunner/Silverlight3.js
File renamed without changes
0  tests/SilverlightConsoleRunner/Silverlight4.js → tools/SilverlightConsoleRunner/Silverlight4.js
File renamed without changes
0  ...ightConsoleRunner/SilverlightConsoleRunner.csproj → ...ightConsoleRunner/SilverlightConsoleRunner.csproj
File renamed without changes
0  ...erlightConsoleRunner/SilverlightConsoleRunner.sln → ...erlightConsoleRunner/SilverlightConsoleRunner.sln
File renamed without changes
0  tests/SilverlightConsoleRunner/XapHost2.html → tools/SilverlightConsoleRunner/XapHost2.html
File renamed without changes
0  tests/SilverlightConsoleRunner/XapHost3.html → tools/SilverlightConsoleRunner/XapHost3.html
File renamed without changes
0  tests/SilverlightConsoleRunner/XapHost4.html → tools/SilverlightConsoleRunner/XapHost4.html
File renamed without changes

No commit comments for this range

Something went wrong with that request. Please try again.