Skip to content

Decouple extension version reporting from MTP AppVersion while preserving CrashDump forward compatibility#7743

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/fix-mtp-appversion-usage
Draft

Decouple extension version reporting from MTP AppVersion while preserving CrashDump forward compatibility#7743
Copilot wants to merge 5 commits intomainfrom
copilot/fix-mtp-appversion-usage

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

Extensions were reporting Version via Microsoft.Testing.Platform.Helpers.AppVersion.DefaultSemVer (through IVT), which incorrectly ties extension version identity to the loaded MTP version. This breaks version accuracy when extension and platform versions differ.

  • Version source correction (extension-local, not platform-local)

    • Added ExtensionVersion helper in each affected extension assembly.
    • Version properties now resolve from the extension assembly metadata (AssemblyInformationalVersionAttribute, fallback to assembly version), instead of AppVersion.DefaultSemVer.
  • CrashDump forward-compatibility adjustment

    • Kept InternalsVisibleTo from Microsoft.Testing.Platform to Microsoft.Testing.Extensions.CrashDump.
    • This is required for forward compatibility with previously shipped CrashDump extension binaries that still access platform internals at runtime.
  • Touched extension areas

    • AzureDevOpsReport
    • CrashDump
    • HangDump
    • MSBuild
    • Retry
    • TrxReport
    • VSTestBridge
  • Focused regression coverage

    • Added unit tests asserting representative extension providers read version from their own assembly path (via extension-local ExtensionVersion) rather than MTP AppVersion.
internal static class ExtensionVersion
{
    public static readonly string DefaultSemVer = GetDefaultSemVer();

    private static string GetDefaultSemVer()
    {
        Assembly extensionAssembly = typeof(ExtensionVersion).Assembly;
        return extensionAssembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion
            ?? extensionAssembly.GetName().Version?.ToString()
            ?? string.Empty;
    }
}

// before: public string Version => AppVersion.DefaultSemVer;
public string Version => ExtensionVersion.DefaultSemVer;

Copilot AI requested review from Copilot and removed request for Copilot April 17, 2026 09:55
Copilot AI linked an issue Apr 17, 2026 that may be closed by this pull request
Copilot AI requested review from Copilot and removed request for Copilot April 17, 2026 10:14
Agent-Logs-Url: https://github.com/microsoft/testfx/sessions/b1573313-b7dd-4dca-a827-51d1ada1e918

Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot April 17, 2026 10:15
Copilot AI changed the title [WIP] Fix MTP AppVersion bug in extensions Decouple extension version reporting from MTP AppVersion and remove CrashDump IVT dependency Apr 17, 2026
Copilot AI requested a review from Evangelink April 17, 2026 10:18
@Evangelink
Copy link
Copy Markdown
Member

@copilot pipeline is red, please fix issues

Copilot AI requested review from Copilot and removed request for Copilot April 17, 2026 12:17
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 17, 2026

@copilot pipeline is red, please fix issues

Pushed a fix in 19b6c12 to address the pipeline issue path: I added an explicit System.Reflection import in ExtensionVersionTests and revalidated with warnings-as-errors build plus targeted extensions unit tests (all passing). Please re-run the PR pipeline on latest commit 19b6c12.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dev.azure.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Evangelink
Copy link
Copy Markdown
Member

@copilot there is a test failure:

Check failure on line 665 in src/TestFramework/TestFramework/Assertions/Assert.AreEqual.cs

@azure-pipelines
azure-pipelines
/ microsoft.testfx (Build Linux Debug)
src/TestFramework/TestFramework/Assertions/Assert.AreEqual.cs#L665

src/TestFramework/TestFramework/Assertions/Assert.AreEqual.cs(665,1): error : [NewerPlatform_WithPreviousExtensions_ShouldExecuteTests] [net11.0] Assert.AreEqual failed. Expected:<0>. Actual:<1>. 'expected' expression: 'exitCode', 'actual' expression: 'testHostResult.ExitCode'. Expression 'AssertExitCodeIs' failed for member 'NewerPlatform_WithPreviousExtensions_ShouldExecuteTests' at line 17 of file '/_/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ForwardCompatibilityTests.cs'. Output of the test host is:
Command: /mnt/vss/_work/1/s/artifacts/tmp/Debug/testsuite/fKP7l/ForwardCompatibilityTest/bin/Release/net10.0/ForwardCompatibilityTest --crashdump --hangdump --report-trx --retry-failed-tests 3

ExitCode: 1

StandardOutput:
Microsoft.Testing.Platform v2.3.0-ci (UTC 04/17/2026) [linux-x64 - net10.0]
Test host process exited before the retry service could connect to it. Exit code: 134

StandardError:
Unhandled exception. System.MethodAccessException: Attempt by method 'Microsoft.Testing.Extensions.CrashDumpExtensions+<>c__DisplayClass0_0.b__0(System.IServiceProvider)' to access method 'Microsoft.Testing.Platform.Services.ServiceProviderExtensions.GetTestApplicationModuleInfo(System.IServiceProvider)' failed.
at Microsoft.Testing.Extensions.CrashDumpExtensions.<>c__DisplayClass0_0.b__0(IServiceProvider serviceProvider) in //src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpExtensions.cs:line 32
at Microsoft.Testing.Platform.TestHostControllers.TestHostControllersManager.BuildAsync(ServiceProvider serviceProvider) in /
/src/Platform/Microsoft.Testing.Platform/TestHostControllers/TestHostControllersManager.cs:line 120
at Microsoft.Testing.Platform.Hosts.TestHostBuilder.BuildAsync(ApplicationLoggingState loggingState, TestApplicationOptions testApplicationOptions, IUnhandledExceptionsHandler unhandledExceptionsHandler, DateTimeOffset createBuilderStart) in //src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.cs:line 447
at Microsoft.Testing.Platform.Builder.TestApplicationBuilder.BuildAsync() in /
/src/Platform/Microsoft.Testing.Platform/Builder/TestApplicationBuilder.cs:line 120
at Program.Main(String[] args) in /mnt/vss/_work/1/s/artifacts/tmp/Debug/testsuite/fKP7l/ForwardCompatibilityTest/Program.cs:line 26
at Program.

(String[] args)

Copilot AI requested review from Copilot and removed request for Copilot April 17, 2026 18:02
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 17, 2026

@copilot there is a test failure:

[Check failure on line 665 in src/TestFramework/TestFramework/Assertions/Assert.AreEqual.cs](https://github.com/microsoft/testfx/pull/7743/files#annotation_5188211...

Fixed in e9afe78: restored InternalsVisibleTo from Microsoft.Testing.Platform to Microsoft.Testing.Extensions.CrashDump to preserve forward compatibility with previous CrashDump extension binaries and avoid the reported MethodAccessException path. I also validated targeted builds/tests locally; the specific forward-compatibility test could not be fully executed in this sandbox due transient package-feed download failures (Resource temporarily unavailable) when restoring 2.2.1 extensions.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 11vvsblobprodcus336.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/testfx/testfx//.dotnet/dotnet /home/REDACTED/work/testfx/testfx//.dotnet/dotnet build /home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/qOqzx/ForwardCompatibilityTest -c Release -p:MSBuildTreatWarningsAsErrors=true -p:TreatWarningsAsErrors=true -p:SuppressNETCoreSdkPreviewMessage=true -bl:/home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/ForwardCompatibilityTest-1.binlog (dns block)
    • Triggering command: /home/REDACTED/work/testfx/testfx//.dotnet/dotnet /home/REDACTED/work/testfx/testfx//.dotnet/dotnet build /home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/kiCDy/ForwardCompatibilityTest -c Release -p:MSBuildTreatWarningsAsErrors=true -p:TreatWarningsAsErrors=true -p:SuppressNETCoreSdkPreviewMessage=true -bl:/home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/ForwardCompatibilityTest-1.binlog (dns block)
  • 1k9vsblobprodcus379.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/testfx/testfx//.dotnet/dotnet /home/REDACTED/work/testfx/testfx//.dotnet/dotnet build /home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/qOqzx/ForwardCompatibilityTest -c Release -p:MSBuildTreatWarningsAsErrors=true -p:TreatWarningsAsErrors=true -p:SuppressNETCoreSdkPreviewMessage=true -bl:/home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/ForwardCompatibilityTest-1.binlog (dns block)
    • Triggering command: /home/REDACTED/work/testfx/testfx//.dotnet/dotnet /home/REDACTED/work/testfx/testfx//.dotnet/dotnet build /home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/kiCDy/ForwardCompatibilityTest -c Release -p:MSBuildTreatWarningsAsErrors=true -p:TreatWarningsAsErrors=true -p:SuppressNETCoreSdkPreviewMessage=true -bl:/home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/ForwardCompatibilityTest-1.binlog (dns block)
  • 7k6vsblobprodcus337.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/testfx/testfx//.dotnet/dotnet /home/REDACTED/work/testfx/testfx//.dotnet/dotnet build /home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/qOqzx/ForwardCompatibilityTest -c Release -p:MSBuildTreatWarningsAsErrors=true -p:TreatWarningsAsErrors=true -p:SuppressNETCoreSdkPreviewMessage=true -bl:/home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/ForwardCompatibilityTest-1.binlog (dns block)
    • Triggering command: /home/REDACTED/work/testfx/testfx//.dotnet/dotnet /home/REDACTED/work/testfx/testfx//.dotnet/dotnet build /home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/kiCDy/ForwardCompatibilityTest -c Release -p:MSBuildTreatWarningsAsErrors=true -p:TreatWarningsAsErrors=true -p:SuppressNETCoreSdkPreviewMessage=true -bl:/home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/ForwardCompatibilityTest-1.binlog (dns block)
  • 7tjvsblobprodcus341.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/testfx/testfx//.dotnet/dotnet /home/REDACTED/work/testfx/testfx//.dotnet/dotnet build /home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/qOqzx/ForwardCompatibilityTest -c Release -p:MSBuildTreatWarningsAsErrors=true -p:TreatWarningsAsErrors=true -p:SuppressNETCoreSdkPreviewMessage=true -bl:/home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/ForwardCompatibilityTest-1.binlog (dns block)
    • Triggering command: /home/REDACTED/work/testfx/testfx//.dotnet/dotnet /home/REDACTED/work/testfx/testfx//.dotnet/dotnet build /home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/kiCDy/ForwardCompatibilityTest -c Release -p:MSBuildTreatWarningsAsErrors=true -p:TreatWarningsAsErrors=true -p:SuppressNETCoreSdkPreviewMessage=true -bl:/home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/ForwardCompatibilityTest-1.binlog (dns block)
  • 80zvsblobprodcus35.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/testfx/testfx//.dotnet/dotnet /home/REDACTED/work/testfx/testfx//.dotnet/dotnet build /home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/qOqzx/ForwardCompatibilityTest -c Release -p:MSBuildTreatWarningsAsErrors=true -p:TreatWarningsAsErrors=true -p:SuppressNETCoreSdkPreviewMessage=true -bl:/home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/ForwardCompatibilityTest-1.binlog (dns block)
    • Triggering command: /home/REDACTED/work/testfx/testfx//.dotnet/dotnet /home/REDACTED/work/testfx/testfx//.dotnet/dotnet build /home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/kiCDy/ForwardCompatibilityTest -c Release -p:MSBuildTreatWarningsAsErrors=true -p:TreatWarningsAsErrors=true -p:SuppressNETCoreSdkPreviewMessage=true -bl:/home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/ForwardCompatibilityTest-1.binlog (dns block)
  • cflvsblobprodcus383.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/testfx/testfx//.dotnet/dotnet /home/REDACTED/work/testfx/testfx//.dotnet/dotnet build /home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/qOqzx/ForwardCompatibilityTest -c Release -p:MSBuildTreatWarningsAsErrors=true -p:TreatWarningsAsErrors=true -p:SuppressNETCoreSdkPreviewMessage=true -bl:/home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/ForwardCompatibilityTest-1.binlog (dns block)
    • Triggering command: /home/REDACTED/work/testfx/testfx//.dotnet/dotnet /home/REDACTED/work/testfx/testfx//.dotnet/dotnet build /home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/kiCDy/ForwardCompatibilityTest -c Release -p:MSBuildTreatWarningsAsErrors=true -p:TreatWarningsAsErrors=true -p:SuppressNETCoreSdkPreviewMessage=true -bl:/home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/ForwardCompatibilityTest-1.binlog (dns block)
  • jrqvsblobprodcus343.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/testfx/testfx//.dotnet/dotnet /home/REDACTED/work/testfx/testfx//.dotnet/dotnet build /home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/qOqzx/ForwardCompatibilityTest -c Release -p:MSBuildTreatWarningsAsErrors=true -p:TreatWarningsAsErrors=true -p:SuppressNETCoreSdkPreviewMessage=true -bl:/home/REDACTED/work/testfx/testfx/artifacts/tmp/Debug/testsuite/ForwardCompatibilityTest-1.binlog (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Decouple extension version reporting from MTP AppVersion and remove CrashDump IVT dependency Decouple extension version reporting from MTP AppVersion while preserving CrashDump forward compatibility Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MTP AppVersion shouldn't be used via IVT by extensions

2 participants