Meziantou.Framework.FullPath
3.0.11
Prefix Reserved
dotnet add package Meziantou.Framework.FullPath --version 3.0.11
NuGet\Install-Package Meziantou.Framework.FullPath -Version 3.0.11
<PackageReference Include="Meziantou.Framework.FullPath" Version="3.0.11" />
<PackageVersion Include="Meziantou.Framework.FullPath" Version="3.0.11" />
<PackageReference Include="Meziantou.Framework.FullPath" />
paket add Meziantou.Framework.FullPath --version 3.0.11
#r "nuget: Meziantou.Framework.FullPath, 3.0.11"
#:package Meziantou.Framework.FullPath@3.0.11
#addin nuget:?package=Meziantou.Framework.FullPath&version=3.0.11
#tool nuget:?package=Meziantou.Framework.FullPath&version=3.0.11
Meziantou.Framework.FullPath
FullPath ensures you always deal with full path in your application and provides many common methods to manipulate paths.
// Create FullPath
FullPath rootPath = FullPath.FromPath("demo"); // It automatically calls Path.GetFullPath to resolve the path
FullPath filePath = FullPath.Combine(rootPath, "temp", "meziantou.txt"); // Use Path.Combine to join paths (you can combine as many path as you needed)
FullPath temp = FullPath.GetTempPath(); // equivalent of Path.GetTempPath()
FullPath cwd = FullPath.CurrentDirectory(); // equivalent of Environment.CurrentDirectory
// Combine path: you can use the / operator to join path
FullPath filePath1 = rootPath / "temp" / "meziantou.txt";
// Or use the + operator to append a suffix to the current path
FullPath backupFilePath = filePath1 + ".bak";
// Compare path
// Comparisons are case-insensitive on Windows, macOS, iOS and tvOS, and case-sensitive elsewhere by default
_ = filePath == rootPath;
_ = filePath.Equals(rootPath, ignoreCase: false);
// Get parent directory
FullPath parent = filePath.Parent;
// Get file/directory name - extension
var name = filePath.Name;
var ext = filePath.Extension;
FullPath pathWithExtension = filePath.WithExtension(".log");
FullPath pathWithAllExtensionsChanged = FullPath.FromPath("archive.tar.gz").WithExtension(".zip", replaceAllTrailingExtensions: true);
FullPath pathWithTwoExtensionsChanged = FullPath.FromPath("archive.tar.gz").WithExtension(".zip", extensionCount: 2);
FullPath pathWithNewName = filePath.WithName("other.txt");
FullPath pathWithNewNameWithoutExtension = filePath.WithNameWithoutExtension("other");
// Make relative path
string relativePath = filePath.MakePathRelativeTo(rootPath); // temp\meziantou.txt
// Check if a path is under another path
bool isChildOf = filePath.IsChildOf(rootPath);
// Resolve to canonical final path (follows symbolic links/reparse points)
if (filePath.TryGetCanonicalPath(out var canonicalPath))
{
Console.WriteLine(canonicalPath);
}
// FullPath is implicitly converted to string, so it works well with File/Directory methods
System.IO.File.WriteAllText(filePath, content);
Native AOT and trimming
The package is annotated IsAotCompatible and IsTrimmable. It does not use reflection, and the native interop is
resolved at compile time.
FullPath is serialized to JSON as a string by FullPathJsonConverter, which also works with the System.Text.Json
source generator:
[JsonSerializable(typeof(Configuration))]
internal sealed partial class AppJsonContext : JsonSerializerContext;
internal sealed record Configuration(FullPath OutputPath);
Analyzer rules
| Id | Category | Description | Severity | Enabled |
|---|---|---|---|---|
MFFP0001 |
FullPath | Use FullPath directly instead of Path.GetFullPath | Info | ✔️ |
MFFP0002 |
FullPath | Use the right FullPath operand directly | Info | ✔️ |
MFFP0003 |
FullPath | Use '/' with a FullPath base instead of Path.GetFullPath | Info | ✔️ |
MFFP0004 |
FullPath | Use '/' operator instead of Path.Combine | Info | ✔️ |
MFFP0005 |
FullPath | Use FullPath.Name instead of Path.GetFileName | Info | ✔️ |
MFFP0006 |
FullPath | Use FullPath.NameWithoutExtension instead of Path.GetFileNameWithoutExtension | Info | ✔️ |
MFFP0007 |
FullPath | Use FullPath.Extension instead of Path.GetExtension | Info | ✔️ |
MFFP0008 |
FullPath | Use FullPath.Parent instead of Path.GetDirectoryName | Info | ✔️ |
MFFP0009 |
FullPath | Use FullPath.WithExtension instead of Path.ChangeExtension | Info | ✔️ |
MFFP0010 |
FullPath | Use FullPath.MakePathRelativeTo instead of Path.GetRelativePath | Info | ✔️ |
MFFP0011 |
FullPath | Return FullPath instead of string | Info | ✔️ |
MFFP0012 |
FullPath | Declare the property as FullPath instead of string | Info | ✔️ |
MFFP0013 |
FullPath | Declare the variable as FullPath instead of string | Info | ✔️ |
MFFP0014 |
FullPath | Declare the parameter as FullPath instead of string | Info | ✔️ |
MFFP0015 |
FullPath | Compare FullPath values instead of their string representation | Warning | ✔️ |
MFFP0016 |
FullPath | FullPath.Equals with a string argument is always false | Warning | ✔️ |
MFFP0018 |
FullPath | Path.IsPathRooted and Path.IsPathFullyQualified are redundant on a FullPath | Info | ✔️ |
MFFP0019 |
FullPath | Simplify the FullPath.FromPath call | Info | ✔️ |
MFFP0020 |
FullPath | Use FullPath.FromFileSystemInfo instead of FullPath.FromPath | Info | ✔️ |
MFFP0021 |
FullPath | Use FullPath.IsEmpty | Info | ✔️ |
MFFP0022 |
FullPath | Use FullPath.CreateParentDirectory instead of Directory.CreateDirectory | Info | ✔️ |
MFFP0023 |
FullPath | Use FullPath.Parent instead of Directory.GetParent | Info | ✔️ |
MFFP0024 |
FullPath | Use the FullPath equivalent of Path.GetTempPath or Environment.GetFolderPath | Info | ✔️ |
Additional resources
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
-
net10.0
- No dependencies.
-
net11.0
- No dependencies.
NuGet packages (7)
Showing the top 5 NuGet packages that depend on Meziantou.Framework.FullPath:
| Package | Downloads |
|---|---|
|
Meziantou.Framework.InlineSnapshotTesting
Enables verification of objects using inline snapshots |
|
|
Meziantou.Framework.TemporaryDirectory
TemporaryDirectory and TemporaryFile allow to create a disposable directory or file to store temporary data |
|
|
Meziantou.Framework.DiffEngine
Locate and resolve external diff tools |
|
|
ANcpLua.Roslyn.Utilities.Testing
Fluent testing framework for Roslyn analyzers, code fixes, and incremental generators with caching validation, forbidden type detection, and comprehensive assertion support. |
|
|
Meziantou.Framework.NuGetPackageValidation
Provide rules to validate a NuGet package follows best practices |
GitHub repositories (3)
Showing the top 3 popular GitHub repositories that depend on Meziantou.Framework.FullPath:
| Repository | Stars |
|---|---|
|
meziantou/Meziantou.Analyzer
A powerful C# Roslyn analyzer that uses static analysis to detect bugs, surface security issues, and enforce best practices—helping developers and AI write more reliable code.
|
|
|
workleap/wl-dotnet-codingstandards
Workleap recommended coding standards for .NET.
|
|
|
meziantou/Meziantou.Polyfill
Source Generator that adds polyfill methods and types so projects targeting older TFMs can compile with source-compatible APIs.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.11 | 260 | 10/11/2026 |
| 3.0.10 | 5,904 | 9/20/2026 |
| 3.0.9 | 2,511 | 9/15/2026 |
| 3.0.8 | 859 | 9/13/2026 |
| 3.0.7 | 746 | 9/11/2026 |
| 3.0.6 | 970 | 9/9/2026 |
| 3.0.5 | 1,155 | 9/6/2026 |
| 3.0.4 | 1,040 | 9/3/2026 |
| 3.0.3 | 2,427 | 8/30/2026 |
| 3.0.2 | 2,258 | 8/23/2026 |
| 3.0.1 | 15,311 | 7/8/2026 |
| 3.0.0 | 1,216 | 7/5/2026 |
| 2.1.7 | 2,854 | 6/28/2026 |
| 2.1.6 | 2,459 | 6/22/2026 |
| 2.1.5 | 3,225 | 6/14/2026 |
| 2.1.4 | 2,102 | 6/13/2026 |
| 2.1.3 | 230 | 6/13/2026 |
| 2.1.2 | 1,891 | 6/7/2026 |
| 2.1.1 | 351 | 6/6/2026 |
| 2.1.0 | 151 | 6/6/2026 |