Skip to content

Throws an exception when opening an existing file #54474

Closed

Description

@Lydia-Shi

Repro Steps

  1. Create NET Core console application
  2. Open Program.cs, add below code for Main method (\\winformtest\WinFormsRuntime\Libs\WFCTestLib\Util\Images\class.ico is an existing icon.)
            String fileName = @"\\winformtest\WinFormsRuntime\Libs\WFCTestLib\Util\Images\class.ico";
            // String fileName = @"C:\Users\v-qiashi\Desktop\Images\test.ico";

            Stream fs = File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
            Icon ico = new Icon(fs);
            fs.Close();
  1. Build and run

Actual result

Throw System.IO.IOException.
image

.NET Core Version

.NET 6.0.100-preview.7.21320.2

Regression?

Yes, this is a regression issue, it cannot repro on .Net 6.0.100-preview.6.21315.23.

More info

This issue not occurs when setting fileName to a local path, like:
String fileName = @"C:\Users\v-qiashi\Desktop\Images\test.ico";

Activity

  1. ghost added
    untriaged
    on Jun 21, 2021
  2. self-assigned this
    on Jun 21, 2021
  3. added this to the 6.0.0 milestone on Jun 21, 2021
  4. removed
    untriaged
    on Jun 21, 2021
  5. adamsitnik commented on Jun 21, 2021

    @adamsitnik
    Member

    @Lydia-Shi big thanks for a very detailed bug report, I am going to fix it asap

  6. ghost added
    in-pr
    on Jun 21, 2021
  7. ghost removed
    in-pr
    on Jun 23, 2021
  8. Lydia-Shi commented on Jun 25, 2021

    @Lydia-Shi
    Author

    This issue has been fixed on .NET SDK latest build 6.0.100-preview.7.21324.6.

  9. adamsitnik commented on Jun 25, 2021

    @adamsitnik
    Member

    @Lydia-Shi big thanks for confirmation! and appologies for the bug. I've added tests in #54483 to ensure the bug is never coming back

  10. ghost locked as resolved and limited conversation to collaborators on Jul 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions