Receiving error "The directory name is invalid" when using MSTest Runner Task

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

When executing an MSTest Runner it fails with the error "The directory name is invalid". Taking the command that is outputted to the log and running it from the command-line works fine.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 03-Nov-2011 14:05:49 Starting task 'Service Unit Tests' of type 'com.atlassian.bamboo.plugin.dotnet:mstestRunner' 03-Nov-2011 14:05:49 Beginning to execute external process for build 'Build Plan - Build Service Layer' ... running command line: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe /testcontainer:trunk\ServiceLayer\Test\QikID.Service.Rest.Test\bin\Debug\QikID.Service.Rest.Test.dll /resultsfile:Trunk\ServiceLayer\Test\testresults.trx ... in: D:\bamboo-home\xml-data\build-dir\QI-QI-JOB1 03-Nov-2011 14:05:50 Microsoft (R) Test Execution Command Line Tool Version 10.0.30319.1 03-Nov-2011 14:05:50 Copyright (c) Microsoft Corporation. All rights reserved. 03-Nov-2011 14:05:50 03-Nov-2011 14:05:50 Loading trunk\ServiceLayer\Test\QikID.Service.Rest.Test\bin\Debug\QikID.Service.Rest.Test.dll... 03-Nov-2011 14:05:50 trunk\ServiceLayer\Test\QikID.Service.Rest.Test\bin\Debug\QikID.Service.Rest.Test.dll 03-Nov-2011 14:05:50 The directory name is invalid. 03-Nov-2011 14:05:52 Parsing test results... 03-Nov-2011 14:05:52 Failing task since test cases were expected but none were found. 03-Nov-2011 14:05:52 Finished task 'QikID REST Service Unit Tests'

Cause

This error usually happens when the Bamboo Server is being run as a Windows Service and the Service is having permissions problems to access local paths.

Workaround

Based on this document: Running Bamboo service on Windows as the local user, if Bamboo is running as a Windows service, make sure that a local user(not a SYSTEM user) runs Bamboo.

Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.