private static void AssertInvalidPath(string path)
{
// Due to different shipping behavior in different products, different exceptions may be thrown
// when an invalid path is specified on different platforms. We try to catch all the types
// that can be thrown here to verify that more exception types are not introduced inadvertently.
Exception e = Assert.ThrowsAny<Exception>(() => XmlReader.Create(path));
Assert.True(e is ArgumentException
|| e is AggregateException
|| e is FileNotFoundException
|| e is FormatException
|| e is UnauthorizedAccessException
|| e is XmlException);
}