46 instantiations of ProjectLocatorException
aspire (13)
Commands\UpdateCommand.cs (3)
706throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist); 7210 => throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound), 722_ => throw new ProjectLocatorException(ErrorStrings.MultipleProjectFilesFound, ProjectLocatorFailureReason.MultipleProjectFilesFound)
Projects\ProjectLocator.cs (10)
998throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable, ProjectLocatorFailureReason.AppHostsMayNotBeBuildable); 1003throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.UnsupportedProjects); 1007throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist); 1035throw new ProjectLocatorException(ErrorStrings.MultipleProjectFilesFound, ProjectLocatorFailureReason.MultipleProjectFilesFound); 1065throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist); 1115throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist); 1162throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.UnsupportedProjects); 1166throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound); 1177throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable, ProjectLocatorFailureReason.AppHostsMayNotBeBuildable); 1215MultipleAppHostProjectsFoundBehavior.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)
90: throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound) 249throw 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)
503catch (ProjectLocatorException ex)
Commands\AgentMcpCommand.cs (1)
153catch (ProjectLocatorException ex)
Commands\AppHostLauncher.cs (1)
183catch (ProjectLocatorException ex)
Commands\BaseCommand.cs (1)
350internal static CommandResult HandleProjectLocatorException(ProjectLocatorException ex, IInteractionService InteractionService, AspireCliTelemetry telemetry)
Commands\IntegrationSearchCommand.cs (1)
148catch (ProjectLocatorException ex)
Commands\PipelineCommandBase.cs (1)
446catch (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)
713catch (ProjectLocatorException ex)
Commands\StopCommand.cs (1)
263catch (ProjectLocatorException ex)
Commands\UpdateCommand.cs (3)
215catch (ProjectLocatorException ex) when (ex.FailureReason is ProjectLocatorFailureReason.NoProjectFileFound or ProjectLocatorFailureReason.ProjectFileDoesntExist) 303catch (ProjectLocatorException ex) when (passedAppHostProjectFile is null && ex.FailureReason == ProjectLocatorFailureReason.NoProjectFileFound) 564catch (ProjectLocatorException ex)
Projects\ProjectLocator.cs (1)
1456public 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 () => 3858await Assert.ThrowsAsync<ProjectLocatorException>(async () =>