Using relative paths in *.ncover file

Using relative paths in *.ncover file

My ncover xml file currently contains absolute paths to the coverage file and test DLL's. Is it possible to have relative file paths in this file?

There are a few elements that must be able to have relative file paths: CoverageDataURL, CommandLineArgs and WorkingDirectory.

The CommandLineArgs can be a tricky one, because it currently contains a value that looks like this:

/testcontainer:"D:\MyProject\MyProject.Tests\bin\Debug\MyProject.Tests.dll"


RE: Using relative paths in *.ncover file

At present you can configure all file paths to be relative from the working folder, but the working folder has to be an absolute path.

We have improved the paths in project files to be relative to the location of the project file for the next release of NCover. We don't have a solid date for that release yet, but we're nearing completion of the changes for the release.


RE: Using relative paths in *.ncover file

Hi Alan,

Currently I'm unable to check the .ncover file in to source control because of this. I'm glad to here this will be solved in the next release of NCover.

Thanks.


RE: Using relative paths in *.ncover file

The new version of NCover solved my problem, which is great. My ncover file however, is located in the root of my solution and the different unit test projects are all referenced from this relative path. The NCover explorer, however, does not allow me to leave the working folder blank, which would be the most logical thing to do since the ncover file is in the root. To solve this, I use the following working folder: Documentation/../

However, this also works: /../MySolution/

This seems a bit awkward. Is this the recommended approach, or is there a more convenient way to write the working folder?


RE: Using relative paths in *.ncover file

Things should work fine to simply use .\ as the directory as well. I'll log an issue for assuming that the working directory is the directory of the project file when a blank working directory is given.