# Getting the Path to Executing Assembly
Getting the path to the currently executing assembly can especially be problematic if using a [[Dotnet Single File Executable|Single File Executable]]. To make sure you get the right path and no exception you should use the following methods:
- Use `AppContext.BaseDirectory` to get files relative to the executable
- To find the name of the executable use the first element of `Environment.GetCommandLineArgs()`, or `ProcessPath` if on .NET 6