Skip to content

Instantly share code, notes, and snippets.

@emmkong
Last active November 28, 2023 08:04
Show Gist options
  • Save emmkong/5555867 to your computer and use it in GitHub Desktop.
Save emmkong/5555867 to your computer and use it in GitHub Desktop.
Get full path from relative path in unit testing
private string GetFolderPath()
{
var currentAssemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase).Replace(@"file:\", string.Empty);
var relativePath = Path.Combine(currentAssemblyPath, @"..\folder");
return Path.GetFullPath(relativePath);
}
@christiandelbianco
Copy link

Great!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment