Nope - filename can be invalid.
authorFrederik Carlier <frederik.carlier@quamotion.mobi>
Fri, 22 Sep 2017 14:06:01 +0000 (16:06 +0200)
committerFrederik Carlier <frederik.carlier@quamotion.mobi>
Fri, 22 Sep 2017 14:06:01 +0000 (16:06 +0200)
Commit migrated from https://github.com/dotnet/corefx/commit/633b2b5d43377a10698939c5b1b452c552d331ad

src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/Metafile.Unix.cs

index b1110d9..8e08eec 100644 (file)
@@ -303,11 +303,6 @@ namespace System.Drawing.Imaging
             // Called in order to emulate exception behavior from netfx related to invalid file paths.
             Path.GetFullPath(fileName);
 
-            if (!File.Exists(fileName))
-            {
-                throw new ArgumentException("path");
-            }
-
             int status = SafeNativeMethods.Gdip.GdipRecordMetafileFileNameI(fileName, referenceHdc, type, ref frameRect,
                 frameUnit, description, out nativeObject);
             SafeNativeMethods.Gdip.CheckStatus(status);