Relative paths

Relative paths

Why is it that NCoverReporting cannot generate a report if the output path specified is a relative path? It excepts an input coverage data file with a relative path but if I try to use one for output I get the error:

Unable to create the 'SymbolModule' report because '..\Output\UnitTests\Debu g\SymbolModule.xml' contains '..\'. Relative path navigation is not permitted.

This is causing me a lot of issues when I try to use the NCoverReporting MSBuild task. Here are the pertinent parts of my MSBuild project:

..\Output\UnitTests\Debug\

<Reports>
  <Report>
    <ReportType>SymbolModule</ReportType>
    <Format>Xml</Format>
    <OutputPath>$(UnitTestDir)SymbolModule.xml</OutputPath>
  </Report>
</Reports>

The problem is that there is no way for me to update the OutputPath xml fragment with a full path using ItemGroup transforms. At least, I couldn't figure one out.

I can get around this issue by not using the OutputReport attribute of NCoverReporting and instead using the deprecated attributes. By doing that I CAN use ItemGroup transforms to get the fullpath to the file.

Any ideas?

Thanks, Dustin


RE: Relative paths

Dustin,

Did Stephen contact you directly with this issue?

Joe Feser


RE: Relative paths

Dustin,

I've emailed this message to you as well. The initial 3.1 release didn't support relative paths because the msdn documentation indicated the static System.IO.Path methods would throw an exception if asked to resolve a relative path because relative path navigation can take a program into a directory it does not have permission to read/write from. Preventing relative paths was a misguided attempt to prevent the error, and has since been liberalized (with exceptions caught and handled appropriatly). The fix will be available in the next release.

Stephen