-2
The following error is shown when executing the command:
NUnit.Engine.NUnitEngineException : The path specified in --result TestResult.xml could not be written to
----> System.UnauthorizedAccessException : O acesso ao caminho 'C:\Windows\System32\TestResult.xml' foi negado.
--NUnitEngineException
The path specified in --result TestResult.xml could not be written to
em NUnit.ConsoleRunner.ConsoleRunner.RunTests(TestPackage package, TestFilter filter)
em NUnit.ConsoleRunner.Program.Main(String[] args)
--
UnauthorizedAccessException
O acesso ao caminho 'C:\Windows\System32\TestResult.xml' foi negado.
em System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
em 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, Boolean useLongPath, Boolean checkHost)
em System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
em NUnit.Engine.Services.NUnit3XmlResultWriter.WriteResultFile(XmlNode resultNode, String outputPath)
em NUnit.ConsoleRunner.ConsoleRunner.RunTests(TestPackage package, TestFilter filter)
The test file . dll path is correct, but the test is not run. How to fix this error?
by the error seems to be an authorization problem for writing (trying to write something in system32 is kind of weird anyway), but I believe it will solve if you open cmd as admin
– Lucas Miranda
As mentioned the error is permissible... but why the hell are you willing to write testresult in that directory?
– Leandro Angelo
It was not I who "devils" set up this path. Nunit has already set the default. The --work= command can be used to define the destination folder. But thanks for the help.
– Bruno Silva