Skip to content

[browser/blazor] enable GenerateRuntimeConfigurationFiles #48916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented May 13, 2025

Contributes to dotnet/runtime#97449
Together with dotnet/runtime#115113
Filled for the broken incrementalism dotnet/runtime#115646

@pavelsavara pavelsavara added this to the 10.0.1xx milestone May 13, 2025
@pavelsavara pavelsavara self-assigned this May 13, 2025
@Copilot Copilot AI review requested due to automatic review settings May 13, 2025 16:27
@pavelsavara pavelsavara requested a review from a team as a code owner May 13, 2025 16:27
@pavelsavara pavelsavara requested a review from maraf May 13, 2025 16:27
@github-actions github-actions bot added the Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch label May 13, 2025
Copy link
Contributor

@Copilot 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 modifies the Blazor WebAssembly SDK targets to conditionally disable the generation of runtime configuration files for Blazor projects until .NET 10. The changes include updating the element to include a condition based on the target framework version.

Copy link
Contributor

Thanks for your PR, @@pavelsavara.
To learn about the PR process and branching schedule of this repo, please take a look at the SDK PR Guide.

@pavelsavara
Copy link
Member Author

Log

[xUnit.net 00:00:42.71]     Microsoft.NET.Sdk.BlazorWebAssembly.Tests.WasmBuildIncrementalismTest.Build_IsIncremental [FAIL]
[xUnit.net 00:00:42.71]       Expected boolean to be True, but found False.
[xUnit.net 00:00:42.72]       Stack Trace:
[xUnit.net 00:00:42.72]            at FluentAssertions.Execution.LateBoundTestFramework.Throw(String message)
[xUnit.net 00:00:42.72]            at FluentAssertions.Execution.DefaultAssertionStrategy.HandleFailure(String message)
[xUnit.net 00:00:42.72]            at FluentAssertions.Execution.AssertionScope.AddPreFormattedFailure(String formattedFailureMessage)
[xUnit.net 00:00:42.72]            at FluentAssertions.Execution.AssertionChain.FailWith(Func`1 getFailureReason)
[xUnit.net 00:00:42.73]            at FluentAssertions.Execution.AssertionChain.FailWith(Func`1 getFailureReason)
[xUnit.net 00:00:42.73]            at FluentAssertions.Execution.AssertionChain.FailWith(String message, Object[] args)
[xUnit.net 00:00:42.74]            at FluentAssertions.Primitives.BooleanAssertions`1.BeTrue(String because, Object[] becauseArgs)
[xUnit.net 00:00:42.74]         /_/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildIncrementalismTest.cs(46,0): at Microsoft.NET.Sdk.BlazorWebAssembly.Tests.WasmBuildIncrementalismTest.Build_IsIncremental()
[xUnit.net 00:00:42.74]            at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
[xUnit.net 00:00:42.74]            at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

@pavelsavara pavelsavara requested review from tmat, arunchndr and a team as code owners May 16, 2025 09:18
@pavelsavara
Copy link
Member Author

@maraf please look again, I made few more changes

@@ -20,7 +20,7 @@ Copyright (c) .NET Foundation. All rights reserved.

<!-- General Properties -->
<PropertyGroup>
<ProjectAssetsFile Condition="'$(ProjectAssetsFile)' == ''">$(MSBuildProjectExtensionsPath)/project.assets.json</ProjectAssetsFile>
<ProjectAssetsFile Condition="'$(ProjectAssetsFile)' == ''">$(MSBuildProjectExtensionsPath)project.assets.json</ProjectAssetsFile>
Copy link
Member

Choose a reason for hiding this comment

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

This change doesn't help us anyway, right?
Should we revert it and make in the build incrementalism tracking issue?

<!-- Turn off parts of the build that do not apply to Blazor projects -->
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
<!-- Turn off parts of the build that do not apply to Blazor projects until Net10 -->
<GenerateRuntimeConfigurationFiles Condition="'$(GenerateRuntimeConfigurationFiles)' == '' and '$(_TargetingNETBefore100)' == 'true'">false</GenerateRuntimeConfigurationFiles>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<GenerateRuntimeConfigurationFiles Condition="'$(GenerateRuntimeConfigurationFiles)' == '' and '$(_TargetingNETBefore100)' == 'true'">false</GenerateRuntimeConfigurationFiles>
<GenerateRuntimeConfigurationFiles Condition="''$(_TargetingNETBefore100)' == 'true'">false</GenerateRuntimeConfigurationFiles>

I think we should maintain the behavior from previous SDK when targeting downlevel versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants