Skip to content

ConfigurationBuilder.AddJsonFile can't fire OnChange event using relative paths #111101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pedrobsaila
Copy link
Contributor

Fixes #71386

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jan 5, 2025
@@ -165,12 +165,17 @@ private IChangeToken GetOrAddChangeToken(string pattern)
}
else
{
changeToken = GetOrAddFilePathChangeToken(pattern);
// get rid of \. in Windows and ./ in UNIX's at the start of path file
var filePath = RemoveRelativePathSegment(pattern);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a breaking change?

Copy link
Contributor Author

@pedrobsaila pedrobsaila Jan 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it breaks anything, it looks like a bug fix to me. Unless, there's someone relying on the fact that on change does not get fired for his files when specifying them with starting ./ which is highly improbable because he could just pass false to AddJsonFile if didn't want to subscribe to them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Extensions-FileSystem 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.

ConfigurationBuilder.AddJsonFile can't fire OnChange event using relative paths
2 participants