test/Shared/FunctionalTests.Transitional/TestHelpers/IOHelpers.cs
/// <summary>
/// Safely deletes the file and ignores any access violation exceptions.
/// </summary>
/// <param name="path"> The directory to delete. </param>
Safely deletes the file and ignores any access violation exceptions.
Safely deletes the file and ignores any access violation exceptions .
[SecuritySafeCritical]
        [PermissionSet(SecurityAction.Assert, Unrestricted = true)]
        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Need to catch everything here.")]
        public static void SafeDeleteFile(string path)
        {
            try
            {
                File.Delete(path);
            }
            catch (Exception)
            {
            }
        }
[ SecuritySafeCritical ] [ PermissionSet ( SecurityAction . Assert , Unrestricted = true ) ] [ SuppressMessage ( " " , " " , Justification = " " ) ] public static void SafeDeleteFile ( string path ) { try { File . Delete ( path ) ; } catch ( Exception ) { } }
Safely deletes the file and ignores any access violation exceptions.
Safely deletes the file and ignores any access violation exceptions .
// Calling File.Delete demands FileIOPermission (Write flag) for the specified path. // ignore exceptions
path
string
The directory to delete.
The directory to delete .