43 instantiations of ProjectLocatorException
aspire (10)
Projects\ProjectLocator.cs (10)
953throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable, ProjectLocatorFailureReason.AppHostsMayNotBeBuildable); 958throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.UnsupportedProjects); 962throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist); 990throw new ProjectLocatorException(ErrorStrings.MultipleProjectFilesFound, ProjectLocatorFailureReason.MultipleProjectFilesFound); 1020throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist); 1070throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist); 1114throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.UnsupportedProjects); 1118throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound); 1129throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable, ProjectLocatorFailureReason.AppHostsMayNotBeBuildable); 1167MultipleAppHostProjectsFoundBehavior.Throw => throw new ProjectLocatorException(ErrorStrings.MultipleProjectFilesFound, ProjectLocatorFailureReason.MultipleProjectFilesFound),
Aspire.Cli.Tests (33)
Backchannel\AppHostConnectionResolverTests.cs (4)
77throw new ProjectLocatorException("should not be invoked", ProjectLocatorFailureReason.ProjectFileDoesntExist); 196throw new ProjectLocatorException("multiple", ProjectLocatorFailureReason.MultipleProjectFilesFound) 234throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable, ProjectLocatorFailureReason.AppHostsMayNotBeBuildable) 269throw new ProjectLocatorException("missing", ProjectLocatorFailureReason.ProjectFileDoesntExist)
Commands\ExtensionInternalCommandTests.cs (4)
362throw new ProjectLocatorException("No AppHost project found.", ProjectLocatorFailureReason.NoProjectFileFound); 367throw new ProjectLocatorException("No AppHost project found.", ProjectLocatorFailureReason.NoProjectFileFound); 376throw new ProjectLocatorException("No AppHost project found.", ProjectLocatorFailureReason.NoProjectFileFound); 384throw new ProjectLocatorException("No AppHost project found.", ProjectLocatorFailureReason.NoProjectFileFound);
Commands\ResourceCommandTests.cs (1)
171throw new ProjectLocatorException("multiple", ProjectLocatorFailureReason.MultipleProjectFilesFound);
Commands\RunCommandTests.cs (12)
1721throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist); 1726throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist); 1731throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist); 1736throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist); 2537throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound); 2542throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound); 2547throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound); 2552throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound); 2562throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.MultipleProjectFilesFound); 2567throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.MultipleProjectFilesFound); 2572throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.MultipleProjectFilesFound); 2577throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.MultipleProjectFilesFound);
Commands\StopCommandTests.cs (2)
332throw new ProjectLocatorException("Project file does not exist.", ProjectLocatorFailureReason.ProjectFileDoesntExist) 1412throw new ProjectLocatorException("Multiple project files found.", ProjectLocatorFailureReason.MultipleProjectFilesFound)
Commands\UpdateCommandRepositoryToolsTests.cs (2)
46: throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound) 205throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.UnsupportedProjects)
Commands\UpdateCommandTests.cs (3)
266throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound); 1384throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound); 1474throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound);
Projects\ProjectLocatorTests.cs (1)
977var exception = new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound);
TestServices\NoProjectFileProjectLocator.cs (4)
12throw new ProjectLocatorException("No project file found.", ProjectLocatorFailureReason.NoProjectFileFound); 17throw new ProjectLocatorException("No project file found.", ProjectLocatorFailureReason.NoProjectFileFound); 22throw new ProjectLocatorException("No project file found.", ProjectLocatorFailureReason.NoProjectFileFound); 27throw new ProjectLocatorException("No project file found.", ProjectLocatorFailureReason.NoProjectFileFound);
49 references to ProjectLocatorException
aspire (17)
Backchannel\AppHostConnectionResolver.cs (1)
130catch (ProjectLocatorException ex)
Commands\AddCommand.cs (1)
443catch (ProjectLocatorException ex)
Commands\AgentMcpCommand.cs (1)
153catch (ProjectLocatorException ex)
Commands\AppHostLauncher.cs (1)
164catch (ProjectLocatorException ex)
Commands\BaseCommand.cs (1)
333internal static CommandResult HandleProjectLocatorException(ProjectLocatorException ex, IInteractionService InteractionService, AspireCliTelemetry telemetry)
Commands\IntegrationSearchCommand.cs (1)
135catch (ProjectLocatorException ex)
Commands\PipelineCommandBase.cs (1)
448catch (ProjectLocatorException ex)
Commands\RestoreCommand.cs (2)
82catch (ProjectLocatorException ex) when (ex.FailureReason is ProjectLocatorFailureReason.NoProjectFileFound or ProjectLocatorFailureReason.ProjectFileDoesntExist) 176catch (ProjectLocatorException ex)
Commands\RunCommand.cs (1)
708catch (ProjectLocatorException ex)
Commands\StopCommand.cs (1)
263catch (ProjectLocatorException ex)
Commands\UpdateCommand.cs (3)
195catch (ProjectLocatorException ex) when (ex.FailureReason is ProjectLocatorFailureReason.NoProjectFileFound or ProjectLocatorFailureReason.ProjectFileDoesntExist) 278catch (ProjectLocatorException ex) when (passedAppHostProjectFile is null && ex.FailureReason == ProjectLocatorFailureReason.NoProjectFileFound) 515catch (ProjectLocatorException ex)
Projects\ProjectLocator.cs (1)
1408public static (int ExitCode, string ErrorMessage) GetExitCodeAndMessage(ProjectLocatorException ex, bool projectOptionSpecifiedAsDirectory = false)
Utils\EnvironmentChecker\AspireVersionCheck.cs (2)
226catch (ProjectLocatorException ex) when (ex.FailureReason is ProjectLocatorFailureReason.NoProjectFileFound or ProjectLocatorFailureReason.ProjectFileDoesntExist) 236catch (ProjectLocatorException ex)
Aspire.Cli.Tests (32)
Projects\ProjectLocatorTests.cs (32)
519var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 666var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 697var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 729var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 977var exception = new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound); 1300var exception = await Assert.ThrowsAsync<ProjectLocatorException>(() => 1399var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2043var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2114var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2359var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2419var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2466var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2594var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 3188var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 3235var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 3291var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 3825await Assert.ThrowsAsync<ProjectLocatorException>(async () =>