-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Throw DirectoryNotFoundException on Image.Save with bad directory #34998
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
Conversation
|
Tagging subscribers to this area: @safern |
We were using a hardcoded path with backslashes. That didn't match the built path for the Assert.
capture it from all Save variations.
|
This is working in .net core, but failing net472 tests. Is this because in that mode it's acting as a facade and just redirecting to the .net framework implementation? If so, I don't see a way of making the tests pass across the board, without understanding the compatibility change, as the behavior in .net 472 was to throw the GDI+ exception as well. |
|
@Macromullet you're exactly right. Some libraries' tests (like this one) test on .NET Framework as well even though we don't update add features to them on .NET Framework any more. This is just to catch inadvertent compat breaks. In this case it's intentional. Please fix it by adding |
|
Thanks @danmosemsft ! |
src/libraries/System.Drawing.Common/src/System/Drawing/Image.cs
Outdated
Show resolved
Hide resolved
to match naming conventions for throw-style methods. Fix #31367
|
The failing check (runtime-live-build (Build OSX x64 release Runtime_Debug)) seems to be a transient issue related to nuget downloads. Is there a way to rerun the pipeline? .dotnet/sdk/5.0.100-preview.4.20202.8/NuGet.targets(128,5): error : (NETCORE_ENGINEERING_TELEMETRY=Restore) The feed 'nuget.org [https://api.nuget.org/v3/index.json]' lists package 'Microsoft.NETCore.DotNetHostResolver.2.1.0' but multiple attempts to download the nupkg have failed. The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the feed and try again. |
|
Yeah. I've been seen that across multiple builds, it seems like nuget.org is having some trouble (probably outage) that is hitting us. We can retry the build when the others finish. Anyway you had a typo which will cause you to update the PR and the builds will restart. |
|
The pipeline seems to stall out from time to time. Is this normal? Is it a prioritization issue via the number of available agents? |
|
@Macromullet yes there are some queues that have been a bit low on machines recently. |
|
So the checks failed here: That's outside the scope of this change. I'm unsure how to proceed since I don't control that body of code. |
|
That completely seems like an unrelated error. Will retry the build, but will save the links to investigate and open an issue accordingly. |
|
Looks like we are good to go now. Thanks! |
|
Thanks, @Macromullet for the contribution 😄! For the test failure I opened #35117 |
This provides a more meaningful exception when saving an Image to a directory that does not exist. Addresses #31367
This does change behavior slightly per https://github.com/dotnet/runtime/blob/master/docs/coding-guidelines/breaking-changes.md#bucket-2-reasonable-grey-area, as previously, the operation would throw a System.Runtime.InteropServices.ExternalException.