Only one project can be opened at a time in ArcGIS Pro. When another project is opened or a new project is created, this property is updated to reflect the newly opened project.
//Gets the current project var project = Project.Current;
//Gets the location of the current project; that is, the path to the current project file (*.aprx) string projectPath = Project.Current.URI;
var projGDBPath = Project.Current.DefaultGeodatabasePath;
//The project's dirty state indicates changes made to the project have not yet been saved. bool isProjectDirty = Project.Current.IsDirty;
Target Platforms: Windows 11, Windows 10, Windows 8.1