Change GetAbsoluteLoggingPath
to extension method
#13571
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisites
Description
While changing the JSON schema generation to a .NET tool that loads an assembly to get the type to generate the schema from (see PR #13560), I encountered the following error:
I'm not a 100% sure why it can't find this assembly, since Umbraco.Core does have a dependency on Microsoft.Extensions.Hosting.Abstractions 7.0.0, but I see the
LoggingSettings
class does use theIHostEnvironment
interface from this assembly since a recent change in PR #13485.Since these changes aren't released yet and the method using
IHostEnvironment
doesn't have to be on the settings class (and shouldn't be to make it a POCO), I've moved it into an extension method. This change is already included in PR #13560, but that might not get merged before the next v11 release, hence the reason for creating this PR 😄Testing should be a simple case of checking the moved code and whether this still builds.