Skip to content

Conversation

@lewing
Copy link
Member

@lewing lewing commented Dec 9, 2025

fixes #122338 (maybe)

@lewing lewing requested a review from pavelsavara December 9, 2025 19:00
@lewing lewing marked this pull request as ready for review December 9, 2025 19:59
@lewing lewing requested a review from maraf as a code owner December 9, 2025 19:59
Copilot AI review requested due to automatic review settings December 9, 2025 19:59
@lewing lewing requested a review from ilonatommy as a code owner December 9, 2025 19:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the AppsettingsTests test by refactoring how target frameworks are accessed in WASM build tests. Instead of duplicating logic to determine the correct target framework based on template type, the code now delegates to the WasmSdkBasedProjectProvider which already knows the appropriate target framework.

  • Adds GetDefaultTargetFramework() method to WasmSdkBasedProjectProvider to expose its configured target framework
  • Removes template-based conditional logic for framework selection in CreateWasmTemplateProject
  • Replaces static DefaultTargetFramework references with calls to _provider.GetDefaultTargetFramework()

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
WasmSdkBasedProjectProvider.cs Adds public accessor method GetDefaultTargetFramework() to expose the private _defaultTargetFramework field
WasmTemplateTestsBase.cs Removes template-based framework selection logic and uses provider's framework consistently across multiple methods
BlazorWasmTestBase.cs Updates GetBlazorBinFrameworkDir to use provider's framework instead of static DefaultTargetFrameworkForBlazor
AppsettingsTests.cs Removes ActiveIssue attribute to re-enable the previously failing test
BuildWasmAppsJobsList.txt Re-adds Wasm.Build.Tests.Blazor.AppsettingsTests to the test jobs list

@lewing lewing closed this Dec 9, 2025
@pavelsavara
Copy link
Member

Log

 Wasm.Build.Tests.Blazor.AppsettingsTests.FileInVfs [FAIL]
      build:
        File sizes don't match for /root/helix/work/workitem/e/dotnet-latest/packs/Microsoft.NETCore.App.Runtime.Mono.browser-wasm/11.0.0-ci/runtimes/browser-wasm/native/dotnet.native.wasm (3122351), and /root/helix/work/workitem/e/wbt artifacts/blazor_Debug_False_waaemljf_mky_鿀蜒枛遫䡫煉/bin/Debug/net10.0/wwwroot/_framework/dotnet.native.2qba9g5fwn.wasm (3000285)
      Stack Trace:
        /_/src/mono/wasm/Wasm.Build.Tests/Common/TestUtils.cs(50,0): at Wasm.Build.Tests.TestUtils.AssertFile(String file0, String file1, String label, Boolean same)
        /_/src/mono/wasm/Wasm.Build.Tests/Common/TestUtils.cs(37,0): at Wasm.Build.Tests.TestUtils.AssertSameFile(String file0, String file1, String label)
        /_/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs(162,0): at Wasm.Build.Tests.WasmSdkBasedProjectProvider.AssertBundle(AssertBundleOptions assertOptions)
        /_/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs(104,0): at Wasm.Build.Tests.WasmSdkBasedProjectProvider.AssertBundle(Configuration config, MSBuildOptions buildOptions, Boolean isUsingWorkloads, Nullable`1 isNativeBuild, Nullable`1 wasmFingerprintDotnetJs)
        /_/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs(191,0): at Wasm.Build.Tests.WasmSdkBasedProjectProvider.AssertWasmSdkBundle(Configuration config, MSBuildOptions buildOptions, Boolean isUsingWorkloads, Nullable`1 isNativeBuild, Nullable`1 wasmFingerprintDotnetJs, String buildOutput)
        /_/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTestsBase.cs(229,0): at Wasm.Build.Tests.WasmTemplateTestsBase.BuildProjectCore(ProjectInfo info, Configuration configuration, MSBuildOptions buildOptions, Nullable`1 isNativeBuild, Nullable`1 wasmFingerprintDotnetJs)
        /_/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTestsBase.cs(168,0): at Wasm.Build.Tests.WasmTemplateTestsBase.BuildProject(ProjectInfo info, Configuration configuration, BuildOptions buildOptions, Nullable`1 isNativeBuild, Nullable`1 wasmFingerprintDotnetJs)
        /_/src/mono/wasm/Wasm.Build.Tests/Blazor/BlazorWasmTestBase.cs(110,0): at Wasm.Build.Tests.BlazorWasmTestBase.BlazorBuild(ProjectInfo info, Configuration config, BuildOptions buildOptions, Nullable`1 isNativeBuild)
        /_/src/mono/wasm/Wasm.Build.Tests/Blazor/BlazorWasmTestBase.cs(101,0): at Wasm.Build.Tests.BlazorWasmTestBase.BlazorBuild(ProjectInfo info, Configuration config, Nullable`1 isNativeBuild)
        /_/src/mono/wasm/Wasm.Build.Tests/Blazor/AppsettingsTests.cs(42,0): at Wasm.Build.Tests.Blazor.AppsettingsTests.FileInVfs()

@lewing
Copy link
Member Author

lewing commented Dec 10, 2025

The issue is that the runtime pack comparison logic is broken when the tfm is not NetCoreAppCurrent. The cause is that the workload check is for net11.0 and that is set to true in this case, but the test is targeting net10.0 because of the template limitation so the pack resolution logic expects to resolve to the 11 workload not the 10 nuget and fails. I'll either fix this runtime pack lookup or skip the test in this case.

@lewing lewing marked this pull request as draft December 10, 2025 15:50
@pavelsavara
Copy link
Member

skip the test in this case.

I guess skipping the test if the versions don't match is legit.

@lewing
Copy link
Member Author

lewing commented Dec 11, 2025

It passed the build but It looks like it may be hitting something related to dotnet/aspnetcore#63507 now when starting the app

[log] appSettings Content '{ "Id": "blazor_Debug_False_kpsdxn0x_vog_鿀蜒枛遫䡫煉" }'
[error] ManagedError: AggregateException_ctor_DefaultMessage (Blazor detected a change in the application's culture that is not supported with the current project configuration. To change culture dynamically during startup, set <BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData> in the application's project file.)
Browser has been disconnected
    Wasm.Build.Tests.Blazor.AppsettingsTests.FileInVfs [FAIL]
      System.TimeoutException : Timeout 30000ms exceeded.
      Call log:
        - waiting for Locator("text=Counter")
      Stack Trace:

cc @dariatiurina

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[browser][WBT] Blazor.AppsettingsTests - disabled

2 participants