Skip to content

Add obsolete compatibility shims for moved Microsoft.Extensions.Logging internal types#127194

Draft
Copilot wants to merge 8 commits intomainfrom
copilot/add-null-scope-type-back
Draft

Add obsolete compatibility shims for moved Microsoft.Extensions.Logging internal types#127194
Copilot wants to merge 8 commits intomainfrom
copilot/add-null-scope-type-back

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

Fixes #127194

Restores source and binary compatibility for types that were previously in *.Internal namespaces. Only [Obsolete(error: true)] + [EditorBrowsable(Never)] shims are added — no new non-obsolete public API surface.

Description

New obsolete shims (all in Microsoft.Extensions.Logging.Abstractions assembly):

Shim Redirects to
Microsoft.Extensions.Logging.Abstractions.Internal.NullScope Microsoft.Extensions.Logging.NullScope
Microsoft.Extensions.Logging.Abstractions.Internal.TypeNameHelper Microsoft.Extensions.Internal.TypeNameHelper
Microsoft.Extensions.Logging.Internal.FormattedLogValues internal FormattedLogValues in same assembly
Microsoft.Extensions.Logging.Internal.LogValuesFormatter internal LogValuesFormatter in same assembly

File naming: shim files follow the *Obsolete.cs convention (NullScopeObsolete.cs, TypeNameHelperObsolete.cs, etc.).

This work is a continuation of #87480, bringing back some additional types scoped out of that first wave. We follow the same pattern as those.

Copilot AI and others added 5 commits April 20, 2026 20:42
…ractions.Internal namespace

Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/5c5fb4d4-ec9e-4d85-a918-813e8b551daf

Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com>
…or TypeNameHelper, FormattedLogValues, LogValuesFormatter, and NullScope

Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/85535733-d8cc-4425-a106-63e3ccf52b70

Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com>
… location conventions

Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/85535733-d8cc-4425-a106-63e3ccf52b70

Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com>
…forwards from Microsoft.Extensions.Logging

Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/6df4e960-8c24-49ae-99ed-239b9771dc2d

Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 21, 2026 00:34
Copilot AI review requested due to automatic review settings April 21, 2026 00:34
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-extensions-logging
See info in area-owners.md if you want to be subscribed.

Copilot AI review requested due to automatic review settings April 21, 2026 02:19
Copy link
Copy Markdown
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 restores source/binary compatibility for older consumers by reintroducing several previously-available *.Internal-namespace types in Microsoft.Extensions.Logging.Abstractions as [Obsolete(error: true)] + [EditorBrowsable(Never)] shims.

Changes:

  • Added obsolete shim types for NullScope and TypeNameHelper under Microsoft.Extensions.Logging.Abstractions.Internal.
  • Added obsolete shim wrapper types for FormattedLogValues and LogValuesFormatter under Microsoft.Extensions.Logging.Internal.
  • Updated the ref project to include System.Collections and extended the reference surface accordingly.

Reviewed changes

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

Show a summary per file
File Description
src/libraries/Microsoft.Extensions.Logging.Abstractions/src/TypeNameHelperObsolete.cs Adds obsolete TypeNameHelper shim forwarding to Microsoft.Extensions.Internal.TypeNameHelper.
src/libraries/Microsoft.Extensions.Logging.Abstractions/src/NullScopeObsolete.cs Adds obsolete NullScope shim type in *.Abstractions.Internal.
src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogValuesFormatterObsolete.cs Adds obsolete wrapper for Microsoft.Extensions.Logging.LogValuesFormatter.
src/libraries/Microsoft.Extensions.Logging.Abstractions/src/FormattedLogValuesObsolete.cs Adds obsolete wrapper for Microsoft.Extensions.Logging.FormattedLogValues.
src/libraries/Microsoft.Extensions.Logging.Abstractions/ref/Microsoft.Extensions.Logging.Abstractions.csproj Adds System.Collections ref dependency for the updated reference surface.
src/libraries/Microsoft.Extensions.Logging.Abstractions/ref/Microsoft.Extensions.Logging.Abstractions.cs Updates reference API surface to include the new obsolete types.

Comment thread src/libraries/Microsoft.Extensions.Logging.Abstractions/src/NullScopeObsolete.cs Outdated
@github-actions

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings April 21, 2026 02:49
@ericstj ericstj force-pushed the copilot/add-null-scope-type-back branch from 6734d8e to 06cd5ec Compare April 21, 2026 02:49
Copy link
Copy Markdown
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 adds [Obsolete(error: true)] + [EditorBrowsable(Never)] compatibility shims in Microsoft.Extensions.Logging.Abstractions to restore source/binary compatibility for previously-available *.Internal types.

Changes:

  • Added obsolete shim types for NullScope, TypeNameHelper, FormattedLogValues, and LogValuesFormatter.
  • Updated the reference assembly surface (ref/*.cs) to include the shims.
  • Updated the ref-project to reference System.Collections (needed by the new ref surface).

Reviewed changes

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

Show a summary per file
File Description
src/libraries/Microsoft.Extensions.Logging.Abstractions/src/TypeNameHelperObsolete.cs Adds obsolete shim forwarding to Microsoft.Extensions.Internal.TypeNameHelper.
src/libraries/Microsoft.Extensions.Logging.Abstractions/src/NullScopeObsolete.cs Adds obsolete shim for prior Abstractions.Internal.NullScope.
src/libraries/Microsoft.Extensions.Logging.Abstractions/src/FormattedLogValuesObsolete.cs Adds obsolete shim wrapping internal Microsoft.Extensions.Logging.FormattedLogValues.
src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogValuesFormatterObsolete.cs Adds obsolete shim wrapping internal Microsoft.Extensions.Logging.LogValuesFormatter.
src/libraries/Microsoft.Extensions.Logging.Abstractions/ref/Microsoft.Extensions.Logging.Abstractions.csproj Adds System.Collections ref dependency for the new reference API types.
src/libraries/Microsoft.Extensions.Logging.Abstractions/ref/Microsoft.Extensions.Logging.Abstractions.cs Adds the shim types to the reference surface.

Comment thread src/libraries/Microsoft.Extensions.Logging.Abstractions/src/NullScopeObsolete.cs Outdated
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.

3 participants