- 
        Couldn't load subscription status. 
- Fork 287
Open
Labels
Description
Describe the bug
Result files added with TestContext.AddResultFile are not saved in the results directory and are referenced by an absolute path when running with MTP.
Using
- .NET 10 RC 2
- MSTestversion 4.0.1
- Microsoft.Testing.Extensions.TrxReportversion 2.0.1
Steps To Reproduce
- Use project from mtp_attachment.zip
- Run with dotnet test --project .\MyProject.csproj -p:UseMtp=true --results-directory=Foobar --report-trx
Expected behavior
- Result files are copied to results directory Foobar.
- Results directory is self-contained.
Actual behavior
Output:
Running tests from bin\Debug\net10.0\MyProject.dll (net10.0|x64)
bin\Debug\net10.0\MyProject.dll (net10.0|x64) passed (346ms)
  In process file artifacts produced:
    - For test 'TestMethod': bin\Debug\net10.0\TestOutput.txt
    - Foobar\somesecretstuff_2025-10-22_10_55_59.8701947.trx
Test run summary: Passed!
  total: 1
  failed: 0
  succeeded: 1
  skipped: 0
  duration: 928ms
And the trx file contains
<ResultFiles>
    <ResultFile path="C:\Temp\mtp_attachment\bin\Debug\net10.0\TestOutput.txt" />
</ResultFiles>