41 instantiations of ProjectLocatorException
aspire (10)
Projects\ProjectLocator.cs (10)
951throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable, ProjectLocatorFailureReason.AppHostsMayNotBeBuildable); 956throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.UnsupportedProjects); 960throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist); 988throw new ProjectLocatorException(ErrorStrings.MultipleProjectFilesFound, ProjectLocatorFailureReason.MultipleProjectFilesFound); 1017throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist); 1067throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist); 1111throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.UnsupportedProjects); 1115throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound); 1126throw 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); 117throw new ProjectLocatorException("multiple", ProjectLocatorFailureReason.MultipleProjectFilesFound) 154throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable, ProjectLocatorFailureReason.AppHostsMayNotBeBuildable) 188throw 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)
1247throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist); 1252throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist); 1257throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist); 1262throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist); 1927throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound); 1932throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound); 1937throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound); 1942throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound); 1952throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.MultipleProjectFilesFound); 1957throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.MultipleProjectFilesFound); 1962throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.MultipleProjectFilesFound); 1967throw 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)
262throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound); 1327throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound); 1417throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound);
Projects\ProjectLocatorTests.cs (1)
949var 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)
117catch (ProjectLocatorException ex)
Commands\AddCommand.cs (1)
414catch (ProjectLocatorException ex)
Commands\AppHostLauncher.cs (1)
163catch (ProjectLocatorException ex)
Commands\BaseCommand.cs (1)
298internal 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)
623catch (ProjectLocatorException ex)
Commands\StopCommand.cs (1)
168catch (ProjectLocatorException ex)
Commands\UpdateCommand.cs (1)
422catch (ProjectLocatorException ex)
Projects\ProjectLocator.cs (1)
1407public 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)
492var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => { 638var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 669var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 701var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 949var exception = new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound); 1272var exception = await Assert.ThrowsAsync<ProjectLocatorException>(() => 1371var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () =>{ 1979var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2050var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2295var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2355var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2402var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 2530var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 3104var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 3151var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 3207var ex = await Assert.ThrowsAsync<ProjectLocatorException>(async () => 3741await Assert.ThrowsAsync<ProjectLocatorException>(async () =>