TryResolveFilePath(String, out FileInfo?) Method

Definition

Namespace CliInvoke
Assembly CliInvoke.dll

Attempts to resolve a file path by delegating to ResolveFilePath(String), swallowing any exception that escapes and reporting failure via the return value.

[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
public bool TryResolveFilePath(string filePathToResolve, scoped out FileInfo? resolvedFilePath)

Parameters

filePathToResolve
String

The file path to resolve.

resolvedFilePath
FileInfo

When this method returns, contains the resolved FileInfo on success; otherwise, null.

Returns

Boolean
true if the file path was resolved successfully; otherwise, false.

Remarks

This wrapper follows the .NET Try* convention: it catches (not just ) and never propagates an exception upward. On failure the underlying exception is discarded and resolvedFilePath is set to null; callers that need the failure cause should use ResolveFilePath(String) instead.