Unhandled exception for /trace option in nunit-console.exe

Bug #1057913 reported by Arnaut Billings
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NUnit V2
Fix Released
High
Charlie Poole

Bug Description

On XP, for the attached empty test library and empty test fixture, nunit-console.exe with /trace=Verbose throws the following unhandled exception:

/cygdrive/c/Program\ Files/NUnit\ 2.6.1/bin/nunit-console.exe ./NUnit/bin/Debug/NUnit.dll /trace=Verbose

Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Documents and Settings\Arnaut\Local Settings\Application Data\NUnit\logs\nunit-console_2708.log'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
   at System.IO.StreamWriter..ctor(String path, Boolean append)
   at NUnit.Core.InternalTraceWriter..ctor(String logName)
   at NUnit.Core.InternalTrace.set_Level(InternalTraceLevel value)
   at NUnit.Core.InternalTrace.Initialize(String logName, InternalTraceLevel level)
   at NUnit.ConsoleRunner.Runner.Main(String[] args)
   at NUnit.ConsoleRunner.Class1.Main(String[] args)

Related branches

Revision history for this message
Arnaut Billings (arnaut-billings) wrote :
Revision history for this message
Charlie Poole (charlie.poole) wrote :

The problem occurs if the log directory doesn't already exist. It needs to be created in that case.

Changed in nunitv2:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.6.2
assignee: nobody → Charlie Poole (charlie.poole)
Changed in nunitv2:
status: Triaged → Fix Committed
Changed in nunitv2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.