Skip to content

Silence experimental coroutine deprecation warnings for local builds#2470

Closed
emmche wants to merge 1 commit into
microsoft:mainfrom
emmche:emmche/silence-experimental-coroutine-warnings
Closed

Silence experimental coroutine deprecation warnings for local builds#2470
emmche wants to merge 1 commit into
microsoft:mainfrom
emmche:emmche/silence-experimental-coroutine-warnings

Conversation

@emmche

@emmche emmche commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

VS2026's MSVC STL emits a hard error (C2338 / STL1011) when <experimental/coroutine> is included without _SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGS. CI already sets this via $env:CL, but local/IDE builds did not.

Description of changes

Add the define (and /wd9047 for the matching command-line warning) to src/Directory.Build.props via ItemDefinitionGroup/ClCompile so every C++ project in the solution inherits it. C# projects ignore ClCompile, so this is safe at solution scope.

Will fast follow with more robust solution.

How changes were validated:

Specify how you tested your changes (i.e. manual/ad-hoc testing, automated testing, new automated tests added)-->

  • Verified local build/deploy + Manual smoke test

VS2026's MSVC STL emits a hard error (C2338 / STL1011) when <experimental/coroutine> is included without _SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGS. CI already sets this via $env:CL, but local/IDE builds did not, breaking Debug|x64 builds.

Add the define (and /wd9047 for the matching command-line warning) to src/Directory.Build.props via ItemDefinitionGroup/ClCompile so every C++ project in the solution inherits it. C# projects ignore ClCompile, so this is safe at solution scope.

Follow-up: migrate off <experimental/coroutine> to the C++20 <coroutine> header and drop /await, then remove the suppression here and in the CI workflow.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@emmche emmche closed this Jun 10, 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.

1 participant