Add obsolete compatibility shims for moved Microsoft.Extensions.Logging internal types#127194
Add obsolete compatibility shims for moved Microsoft.Extensions.Logging internal types#127194
Conversation
…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>
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/0590d250-7011-4a2b-822c-8e0a47df5fcd 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>
|
Tagging subscribers to this area: @dotnet/area-extensions-logging |
There was a problem hiding this comment.
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
NullScopeandTypeNameHelperunderMicrosoft.Extensions.Logging.Abstractions.Internal. - Added obsolete shim wrapper types for
FormattedLogValuesandLogValuesFormatterunderMicrosoft.Extensions.Logging.Internal. - Updated the ref project to include
System.Collectionsand 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. |
This comment was marked as outdated.
This comment was marked as outdated.
6734d8e to
06cd5ec
Compare
There was a problem hiding this comment.
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, andLogValuesFormatter. - 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. |
Fixes #127194
Restores source and binary compatibility for types that were previously in
*.Internalnamespaces. 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.Abstractionsassembly):Microsoft.Extensions.Logging.Abstractions.Internal.NullScopeMicrosoft.Extensions.Logging.NullScopeMicrosoft.Extensions.Logging.Abstractions.Internal.TypeNameHelperMicrosoft.Extensions.Internal.TypeNameHelperMicrosoft.Extensions.Logging.Internal.FormattedLogValuesFormattedLogValuesin same assemblyMicrosoft.Extensions.Logging.Internal.LogValuesFormatterLogValuesFormatterin same assemblyFile naming: shim files follow the
*Obsolete.csconvention (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.