Skip to content

Allow File.Open to create the logging file with the correct sharing permissions #4358

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 1 commit into
base: main
Choose a base branch
from

Conversation

weavc
Copy link

@weavc weavc commented Apr 10, 2025

Seems to be throwing an exception when opening the json file when the provider creates new instances, File.Create seems to lock the file.

Unsure what's changed recently to cause this, will try do some additional investigation later, but for now a custom build with this change has unblocked me

Issue describing the changes in this PR

resolves #4263

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • I have added all required tests (Unit tests, E2E tests)

@weavc weavc requested a review from a team as a code owner April 10, 2025 12:28
@weavc
Copy link
Author

weavc commented Apr 11, 2025

I cant find any changes that have caused this issue, I wonder if its been there a while and we've only started to see this due to the updates in the Azure toolkit for Rider plugin.

I would say the change is valid as File.Create does lock the file as its meant to, however this prevents any new instances of the ColoredConsoleLogger being instantiated due being unable to open the file. If the file is created (and closed) before starting the host it works as intended, but if func is responsible for creating the file we see the errors outlined in #4263.

I did try adding additional test coverage for this into the E2E tests but they seem rather sketchy at the moment, not sure if they are being reworked or this is them working as intended and I've misunderstood how they work. Mine are waiting for the timeout on each test (many of the start tests are 5 minutes each) and they ignore exceptions from asserts in the tests you pass through to CliTester, it just proceeds to pass the tests. Please advise if you want additional tests for this change.

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.

Cannot access a disposed object: IServiceProvider when outputting to json
1 participant