I have the following lines in my MSBuild project file:
<PropertyGroup>
<TestResultsFileName Condition=" '$(TestResultsFileName)' == '' ">
TestResults.trx
</TestResultsFileName>
<TestResultsFilePath>$(OutDir)\$(TestResultsFileName)</TestResultsFilePath>
</PropertyGroup>
I need to create another file, having the same name as TestResultsFilePath only with the .xml extension. So I want to have a property to hold the file path of the other file.
At first, I thought that something like this would work:
<PropertyGroup>
<NUnitResultsFilePath>
$(OutDir)\$(TestResultsFileName->'%(Filename).xml')
</NUnitResultsFilePath>
</PropertyGroup>
And, of course, it did not, because TestResultsFileName is not an item collection. Unfortunately, it cannot be such, because it is a parameter to some task that expects a simple value, not a collection.
So, my question is how can I replace the extension of the TestResultsFileName property value with .xml?
Thanks.