46 instantiations of ProjectLocatorException
aspire (13)
Commands\UpdateCommand.cs (3)
706
throw new
ProjectLocatorException
(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist);
721
0 => throw new
ProjectLocatorException
(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound),
722
_ => throw new
ProjectLocatorException
(ErrorStrings.MultipleProjectFilesFound, ProjectLocatorFailureReason.MultipleProjectFilesFound)
Projects\ProjectLocator.cs (10)
998
throw new
ProjectLocatorException
(ErrorStrings.AppHostsMayNotBeBuildable, ProjectLocatorFailureReason.AppHostsMayNotBeBuildable);
1003
throw new
ProjectLocatorException
(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.UnsupportedProjects);
1007
throw new
ProjectLocatorException
(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist);
1035
throw new
ProjectLocatorException
(ErrorStrings.MultipleProjectFilesFound, ProjectLocatorFailureReason.MultipleProjectFilesFound);
1065
throw new
ProjectLocatorException
(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist);
1115
throw new
ProjectLocatorException
(ErrorStrings.ProjectFileDoesntExist, ProjectLocatorFailureReason.ProjectFileDoesntExist);
1162
throw new
ProjectLocatorException
(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.UnsupportedProjects);
1166
throw new
ProjectLocatorException
(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound);
1177
throw new
ProjectLocatorException
(ErrorStrings.AppHostsMayNotBeBuildable, ProjectLocatorFailureReason.AppHostsMayNotBeBuildable);
1215
MultipleAppHostProjectsFoundBehavior.Throw => throw new
ProjectLocatorException
(ErrorStrings.MultipleProjectFilesFound, ProjectLocatorFailureReason.MultipleProjectFilesFound),
Aspire.Cli.Tests (33)
Backchannel\AppHostConnectionResolverTests.cs (4)
77
throw new
ProjectLocatorException
("should not be invoked", ProjectLocatorFailureReason.ProjectFileDoesntExist);
196
throw new
ProjectLocatorException
("multiple", ProjectLocatorFailureReason.MultipleProjectFilesFound)
234
throw new
ProjectLocatorException
(ErrorStrings.AppHostsMayNotBeBuildable, ProjectLocatorFailureReason.AppHostsMayNotBeBuildable)
269
throw new
ProjectLocatorException
("missing", ProjectLocatorFailureReason.ProjectFileDoesntExist)
Commands\ExtensionInternalCommandTests.cs (4)
362
throw new
ProjectLocatorException
("No AppHost project found.", ProjectLocatorFailureReason.NoProjectFileFound);
367
throw new
ProjectLocatorException
("No AppHost project found.", ProjectLocatorFailureReason.NoProjectFileFound);
376
throw new
ProjectLocatorException
("No AppHost project found.", ProjectLocatorFailureReason.NoProjectFileFound);
384
throw new
ProjectLocatorException
("No AppHost project found.", ProjectLocatorFailureReason.NoProjectFileFound);
Commands\ResourceCommandTests.cs (1)
171
throw new
ProjectLocatorException
("multiple", ProjectLocatorFailureReason.MultipleProjectFilesFound);
Commands\RunCommandTests.cs (12)
1721
throw new Aspire.Cli.Projects.
ProjectLocatorException
("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist);
1726
throw new Aspire.Cli.Projects.
ProjectLocatorException
("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist);
1731
throw new Aspire.Cli.Projects.
ProjectLocatorException
("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist);
1736
throw new Aspire.Cli.Projects.
ProjectLocatorException
("Project file does not exist.", Aspire.Cli.Projects.ProjectLocatorFailureReason.ProjectFileDoesntExist);
2537
throw new Aspire.Cli.Projects.
ProjectLocatorException
("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound);
2542
throw new Aspire.Cli.Projects.
ProjectLocatorException
("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound);
2547
throw new Aspire.Cli.Projects.
ProjectLocatorException
("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound);
2552
throw new Aspire.Cli.Projects.
ProjectLocatorException
("No project file found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.NoProjectFileFound);
2562
throw new Aspire.Cli.Projects.
ProjectLocatorException
("Multiple project files found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.MultipleProjectFilesFound);
2567
throw new Aspire.Cli.Projects.
ProjectLocatorException
("Multiple project files found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.MultipleProjectFilesFound);
2572
throw new Aspire.Cli.Projects.
ProjectLocatorException
("Multiple project files found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.MultipleProjectFilesFound);
2577
throw new Aspire.Cli.Projects.
ProjectLocatorException
("Multiple project files found.", Aspire.Cli.Projects.ProjectLocatorFailureReason.MultipleProjectFilesFound);
Commands\StopCommandTests.cs (2)
332
throw new
ProjectLocatorException
("Project file does not exist.", ProjectLocatorFailureReason.ProjectFileDoesntExist)
1412
throw new
ProjectLocatorException
("Multiple project files found.", ProjectLocatorFailureReason.MultipleProjectFilesFound)
Commands\UpdateCommandRepositoryToolsTests.cs (2)
90
: throw new
ProjectLocatorException
(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound)
249
throw new
ProjectLocatorException
(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.UnsupportedProjects)
Commands\UpdateCommandTests.cs (3)
266
throw new
ProjectLocatorException
(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound);
1384
throw new
ProjectLocatorException
(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound);
1474
throw new
ProjectLocatorException
(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound);
Projects\ProjectLocatorTests.cs (1)
977
var exception = new
ProjectLocatorException
(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound);
TestServices\NoProjectFileProjectLocator.cs (4)
12
throw new
ProjectLocatorException
("No project file found.", ProjectLocatorFailureReason.NoProjectFileFound);
17
throw new
ProjectLocatorException
("No project file found.", ProjectLocatorFailureReason.NoProjectFileFound);
22
throw new
ProjectLocatorException
("No project file found.", ProjectLocatorFailureReason.NoProjectFileFound);
27
throw new
ProjectLocatorException
("No project file found.", ProjectLocatorFailureReason.NoProjectFileFound);
49 references to ProjectLocatorException
aspire (17)
Backchannel\AppHostConnectionResolver.cs (1)
130
catch (
ProjectLocatorException
ex)
Commands\AddCommand.cs (1)
503
catch (
ProjectLocatorException
ex)
Commands\AgentMcpCommand.cs (1)
153
catch (
ProjectLocatorException
ex)
Commands\AppHostLauncher.cs (1)
183
catch (
ProjectLocatorException
ex)
Commands\BaseCommand.cs (1)
350
internal static CommandResult HandleProjectLocatorException(
ProjectLocatorException
ex, IInteractionService InteractionService, AspireCliTelemetry telemetry)
Commands\IntegrationSearchCommand.cs (1)
148
catch (
ProjectLocatorException
ex)
Commands\PipelineCommandBase.cs (1)
446
catch (
ProjectLocatorException
ex)
Commands\RestoreCommand.cs (2)
82
catch (
ProjectLocatorException
ex) when (ex.FailureReason is ProjectLocatorFailureReason.NoProjectFileFound or ProjectLocatorFailureReason.ProjectFileDoesntExist)
176
catch (
ProjectLocatorException
ex)
Commands\RunCommand.cs (1)
713
catch (
ProjectLocatorException
ex)
Commands\StopCommand.cs (1)
263
catch (
ProjectLocatorException
ex)
Commands\UpdateCommand.cs (3)
215
catch (
ProjectLocatorException
ex) when (ex.FailureReason is ProjectLocatorFailureReason.NoProjectFileFound or ProjectLocatorFailureReason.ProjectFileDoesntExist)
303
catch (
ProjectLocatorException
ex) when (passedAppHostProjectFile is null && ex.FailureReason == ProjectLocatorFailureReason.NoProjectFileFound)
564
catch (
ProjectLocatorException
ex)
Projects\ProjectLocator.cs (1)
1456
public static (int ExitCode, string ErrorMessage) GetExitCodeAndMessage(
ProjectLocatorException
ex, bool projectOptionSpecifiedAsDirectory = false)
Utils\EnvironmentChecker\AspireVersionCheck.cs (2)
226
catch (
ProjectLocatorException
ex) when (ex.FailureReason is ProjectLocatorFailureReason.NoProjectFileFound or ProjectLocatorFailureReason.ProjectFileDoesntExist)
236
catch (
ProjectLocatorException
ex)
Aspire.Cli.Tests (32)
Projects\ProjectLocatorTests.cs (32)
519
var
ex = await Assert.ThrowsAsync<
ProjectLocatorException
>(async () =>
666
var
ex = await Assert.ThrowsAsync<
ProjectLocatorException
>(async () =>
697
var
ex = await Assert.ThrowsAsync<
ProjectLocatorException
>(async () =>
729
var
ex = await Assert.ThrowsAsync<
ProjectLocatorException
>(async () =>
977
var
exception = new ProjectLocatorException(ErrorStrings.NoProjectFileFound, ProjectLocatorFailureReason.NoProjectFileFound);
1300
var
exception = await Assert.ThrowsAsync<
ProjectLocatorException
>(() =>
1399
var
ex = await Assert.ThrowsAsync<
ProjectLocatorException
>(async () =>
2043
var
ex = await Assert.ThrowsAsync<
ProjectLocatorException
>(async () =>
2114
var
ex = await Assert.ThrowsAsync<
ProjectLocatorException
>(async () =>
2359
var
ex = await Assert.ThrowsAsync<
ProjectLocatorException
>(async () =>
2419
var
ex = await Assert.ThrowsAsync<
ProjectLocatorException
>(async () =>
2466
var
ex = await Assert.ThrowsAsync<
ProjectLocatorException
>(async () =>
2594
var
ex = await Assert.ThrowsAsync<
ProjectLocatorException
>(async () =>
3188
var
ex = await Assert.ThrowsAsync<
ProjectLocatorException
>(async () =>
3235
var
ex = await Assert.ThrowsAsync<
ProjectLocatorException
>(async () =>
3291
var
ex = await Assert.ThrowsAsync<
ProjectLocatorException
>(async () =>
3858
await Assert.ThrowsAsync<
ProjectLocatorException
>(async () =>