NuGet.PathUtility.GetAbsolutePath C# (CSharp) Method

GetAbsolutePath() public static method

public static GetAbsolutePath ( string basePath, string relativePath ) : string
basePath string
relativePath string
return string
        public static string GetAbsolutePath(string basePath, string relativePath)
        {
            if (basePath == null)
            {
                throw new ArgumentNullException("basePath");
            }

            if (relativePath == null)
            {
                throw new ArgumentNullException("relativePath");
            }

            Uri resultUri = new Uri(new Uri(basePath), new Uri(relativePath, UriKind.Relative));
            return resultUri.LocalPath;
        }

Usage Example

        protected virtual IPackageRepository CreateRepository(string path)
        {
            string root         = PathUtility.EnsureTrailingSlash(FileSystem.Root);
            string absolutePath = PathUtility.GetAbsolutePath(root, path);

            return(new PackageReferenceRepository(absolutePath, sourceRepository: this));
        }
All Usage Examples Of NuGet.PathUtility::GetAbsolutePath