Skip to content

Disable runtime-async for ppc64le, s390x, and Mono runtimes - #68974

Draft
shrinivas-sidral wants to merge 1 commit into
dotnet:release/11.0from
shrinivas-sidral:shrinivas-sidral-IL-code
Draft

Disable runtime-async for ppc64le, s390x, and Mono runtimes#68974
shrinivas-sidral wants to merge 1 commit into
dotnet:release/11.0from
shrinivas-sidral:shrinivas-sidral-IL-code

Conversation

@shrinivas-sidral

@shrinivas-sidral shrinivas-sidral commented Sep 2, 2026

Copy link
Copy Markdown

[ppc64le][s390x][Mono] Disable runtime-async feature on unsupported architectures

Disable runtime-async for ppc64le, s390x, and Mono builds to resolve InvalidProgramException test failures.

Description

ASP.NET Core enables the experimental runtime-async feature (<Features>$(Features);runtime-async=on</Features>) for net11.0 framework and test assemblies.

The Mono runtime and JIT backends for ppc64le and s390x do not support this new async IL format. This causes widespread System.InvalidProgramException: Invalid IL code ... ret failures at runtime (such as in GenericWebHostService:StartAsync), breaking test execution.

Changes

  • Defined <UseRuntimeAsync>false</UseRuntimeAsync> in Directory.Build.props when TargetArchitecture is ppc64le or s390x, or when DotNetBuildUseMonoRuntime is true.
  • Guarded runtime-async=on in Directory.Build.targets with '$(UseRuntimeAsync)' != 'false' to ensure it is not passed on unsupported targets.

Fixes #68067

Cc: @tmds @omajid

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Sep 2, 2026
@tmds

tmds commented Sep 2, 2026

Copy link
Copy Markdown
Member

Implicit Defaults: In the .NET 11 SDK, Roslyn's internal default for net11.0 targets is runtime-async=on.

@shrinivas-sidral can you clarify this? Afaik the .NET 11 SDK doesn't default to runtime-async=on. I think if it is on, it is by aspnetcore Directory.Build.targets.

@shrinivas-sidral

Copy link
Copy Markdown
Author

Implicit Defaults: In the .NET 11 SDK, Roslyn's internal default for net11.0 targets is runtime-async=on.

@shrinivas-sidral can you clarify this? Afaik the .NET 11 SDK doesn't default to runtime-async=on. I think if it is on, it is by aspnetcore Directory.Build.targets.

Thanks @tmds for pointing that out. The earlier PR description was incorrect, which led to that confusion—sorry about that!

@tmds

tmds commented Sep 2, 2026

Copy link
Copy Markdown
Member

I think if it is on, it is by aspnetcore Directory.Build.targets.

Assuming the above, then it should never be turned on when DotNetBuildUseMonoRuntime=true:

<!-- Enable runtime async for net11.0+ source projects that ship only in the Shared Framework -->
<PropertyGroup Condition="'$(IsAspNetCoreApp)' == 'true' AND
'$(IsPackable)' != 'true' AND
$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net11.0')) AND
'$(UseRuntimeAsync)' != 'false' AND
'$(DotNetBuildUseMonoRuntime)' != 'true' AND
'$(TargetOS)' != 'browser' AND
!$(RuntimeIdentifier.StartsWith('browser-'))">
<Features>$(Features);runtime-async=on</Features>
</PropertyGroup>

Depending on how you run the build/test you may manually have to add /p:DotNetBuildUseMonoRuntime=true.

The changes in this PR shouldn't be needed.

@shrinivas-sidral

Copy link
Copy Markdown
Author

@dotnet-policy-service agree company="IBM"

@Youssef1313 Youssef1313 added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Sep 2, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at.

@tmds

tmds commented Sep 3, 2026

Copy link
Copy Markdown
Member

@shrinivas-sidral and I are looking into why DotNetBuildUseMonoRuntime=true doesn't seem to be working sometimes. We'll post an update. No need to review until then.

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

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants