66 references to ProjectLocatorFailureReason
aspire (25)
Commands\RestoreCommand.cs (2)
82
catch (ProjectLocatorException ex) when (ex.FailureReason is
ProjectLocatorFailureReason
.NoProjectFileFound or
ProjectLocatorFailureReason
.ProjectFileDoesntExist)
Projects\ProjectLocator.cs (21)
945
throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable,
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable);
950
throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.UnsupportedProjects);
954
throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist,
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
982
throw new ProjectLocatorException(ErrorStrings.MultipleProjectFilesFound,
ProjectLocatorFailureReason
.MultipleProjectFilesFound);
1012
throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist,
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
1062
throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist,
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
1106
throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.UnsupportedProjects);
1110
throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.NoProjectFileFound);
1121
throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable,
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable);
1159
MultipleAppHostProjectsFoundBehavior.Throw => throw new ProjectLocatorException(ErrorStrings.MultipleProjectFilesFound,
ProjectLocatorFailureReason
.MultipleProjectFilesFound),
1417
internal class ProjectLocatorException(string message,
ProjectLocatorFailureReason
failureReason) : System.Exception(message)
1419
public
ProjectLocatorFailureReason
FailureReason { get; } = failureReason;
1430
ProjectLocatorFailureReason
.MultipleProjectFilesFound when projectOptionSpecifiedAsDirectory
1432
ProjectLocatorFailureReason
.ProjectFileDoesntExist or
ProjectLocatorFailureReason
.NoProjectFileFound when projectOptionSpecifiedAsDirectory
1434
ProjectLocatorFailureReason
.UnsupportedProjects
1436
ProjectLocatorFailureReason
.ProjectFileNotAppHostProject
1438
ProjectLocatorFailureReason
.ProjectFileDoesntExist
1440
ProjectLocatorFailureReason
.MultipleProjectFilesFound
1442
ProjectLocatorFailureReason
.NoProjectFileFound
1444
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable
Utils\EnvironmentChecker\AspireVersionCheck.cs (2)
226
catch (ProjectLocatorException ex) when (ex.FailureReason is
ProjectLocatorFailureReason
.NoProjectFileFound or
ProjectLocatorFailureReason
.ProjectFileDoesntExist)
Aspire.Cli.Tests (41)
Backchannel\AppHostConnectionResolverTests.cs (4)
33
throw new ProjectLocatorException("should not be invoked",
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
114
throw new ProjectLocatorException("multiple",
ProjectLocatorFailureReason
.MultipleProjectFilesFound)
151
throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable,
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable)
185
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)
1664
throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
1669
throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
1674
throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
1679
throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
2480
throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.NoProjectFileFound);
2485
throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.NoProjectFileFound);
2490
throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.NoProjectFileFound);
2495
throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.NoProjectFileFound);
2505
throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.MultipleProjectFilesFound);
2510
throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.MultipleProjectFilesFound);
2515
throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.MultipleProjectFilesFound);
2520
throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.MultipleProjectFilesFound);
Commands\StopCommandTests.cs (2)
67
throw new ProjectLocatorException("Project file does not exist.",
ProjectLocatorFailureReason
.ProjectFileDoesntExist)
1138
throw new ProjectLocatorException("Multiple project files found.",
ProjectLocatorFailureReason
.MultipleProjectFilesFound)
Commands\UpdateCommandTests.cs (3)
266
throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.NoProjectFileFound);
1331
throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.NoProjectFileFound);
1421
throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.NoProjectFileFound);
Projects\ProjectLocatorTests.cs (11)
675
Assert.Equal(
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable, ex.FailureReason);
706
Assert.Equal(
ProjectLocatorFailureReason
.ProjectFileDoesntExist, ex.FailureReason);
738
Assert.Equal(
ProjectLocatorFailureReason
.ProjectFileDoesntExist, ex.FailureReason);
976
var exception = new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.NoProjectFileFound);
1306
Assert.Equal(
ProjectLocatorFailureReason
.UnsupportedProjects, exception.FailureReason);
2427
Assert.Equal(
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable, ex.FailureReason);
2474
Assert.Equal(
ProjectLocatorFailureReason
.ProjectFileDoesntExist, ex.FailureReason);
2602
Assert.Equal(
ProjectLocatorFailureReason
.ProjectFileDoesntExist, ex.FailureReason);
3191
Assert.Equal(
ProjectLocatorFailureReason
.MultipleProjectFilesFound, ex.FailureReason);
3238
Assert.Equal(
ProjectLocatorFailureReason
.MultipleProjectFilesFound, ex.FailureReason);
3294
Assert.Equal(
ProjectLocatorFailureReason
.MultipleProjectFilesFound, ex.FailureReason);
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);