41 instantiations of ProjectLocatorException
aspire (10)
Projects\ProjectLocator.cs (10)
945throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable, ProjectLocatorFailureReason.AppHostsMayNotBeBuildable); 950throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.UnsupportedProjects); 954throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist); 982throw new ProjectLocatorException(ErrorStrings.MultipleProjectFilesFound, ProjectLocatorFailureReason.MultipleProjectFilesFound); 1012throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist); 1062throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist); 1106throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.UnsupportedProjects); 1110throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound); 1121throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable, ProjectLocatorFailureReason.AppHostsMayNotBeBuildable); 1159MultipleAppHostProjectsFoundBehavior.Throw => throw new ProjectLocatorException(ErrorStrings.MultipleProjectFilesFound, ProjectLocatorFailureReason.MultipleProjectFilesFound),
Aspire.Cli.Tests (31)
Backchannel\AppHostConnectionResolverTests.cs (4)
33throw new ProjectLocatorException("should not be invoked", ProjectLocatorFailureReason.ProjectFileDoesntExist); 114throw new ProjectLocatorException("multiple", ProjectLocatorFailureReason.MultipleProjectFilesFound) 151throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable, ProjectLocatorFailureReason.AppHostsMayNotBeBuildable) 185throw 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)
1664throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist); 1669throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist); 1674throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist); 1679throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist); 2480throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound); 2485throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound); 2490throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound); 2495throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound); 2505throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.MultipleProjectFilesFound); 2510throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.MultipleProjectFilesFound); 2515throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.MultipleProjectFilesFound); 2520throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.MultipleProjectFilesFound);
Commands\StopCommandTests.cs (2)
67throw new ProjectLocatorException("Project file does not exist.", ProjectLocatorFailureReason.ProjectFileDoesntExist) 1138throw new ProjectLocatorException("Multiple project files found.", ProjectLocatorFailureReason.MultipleProjectFilesFound)
Commands\UpdateCommandTests.cs (3)
266throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound); 1331throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound); 1421throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound);
Projects\ProjectLocatorTests.cs (1)
976var 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);
46 references to ProjectLocatorException
aspire (14)
Backchannel\AppHostConnectionResolver.cs (1)
118catch (ProjectLocatorException ex)
Commands\AddCommand.cs (1)
414catch (ProjectLocatorException ex)
Commands\AppHostLauncher.cs (1)
164catch (ProjectLocatorException ex)
Commands\BaseCommand.cs (1)
308internal static CommandResult HandleProjectLocatorException(ProjectLocatorException ex, IInteractionService InteractionService, AspireCliTelemetry telemetry)
Commands\IntegrationSearchCommand.cs (1)
133catch (ProjectLocatorException ex)
Commands\PipelineCommandBase.cs (1)
423catch (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)
700catch (ProjectLocatorException ex)
Commands\StopCommand.cs (1)
169catch (ProjectLocatorException ex)
Commands\UpdateCommand.cs (1)
422catch (ProjectLocatorException ex)
Projects\ProjectLocator.cs (1)
1424public 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 () => { 665var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 696var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 728var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 976var exception = new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound); 1299var exception = await Assert.ThrowsAsync<ProjectLocatorException>(() => 1398var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () =>{ 2041var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2112var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2357var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2417var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2464var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2592var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 3186var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 3233var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 3289var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 3823await Assert.ThrowsAsync<ProjectLocatorException>(async () =>