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)
951
throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable,
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable);
956
throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.UnsupportedProjects);
960
throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist,
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
988
throw new ProjectLocatorException(ErrorStrings.MultipleProjectFilesFound,
ProjectLocatorFailureReason
.MultipleProjectFilesFound);
1017
throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist,
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
1067
throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist,
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
1111
throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.UnsupportedProjects);
1115
throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.NoProjectFileFound);
1126
throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable,
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable);
1159
MultipleAppHostProjectsFoundBehavior.Throw => throw new ProjectLocatorException(ErrorStrings.MultipleProjectFilesFound,
ProjectLocatorFailureReason
.MultipleProjectFilesFound),
1400
internal class ProjectLocatorException(string message,
ProjectLocatorFailureReason
failureReason) : System.Exception(message)
1402
public
ProjectLocatorFailureReason
FailureReason { get; } = failureReason;
1413
ProjectLocatorFailureReason
.MultipleProjectFilesFound when projectOptionSpecifiedAsDirectory
1415
ProjectLocatorFailureReason
.ProjectFileDoesntExist or
ProjectLocatorFailureReason
.NoProjectFileFound when projectOptionSpecifiedAsDirectory
1417
ProjectLocatorFailureReason
.UnsupportedProjects
1419
ProjectLocatorFailureReason
.ProjectFileNotAppHostProject
1421
ProjectLocatorFailureReason
.ProjectFileDoesntExist
1423
ProjectLocatorFailureReason
.MultipleProjectFilesFound
1425
ProjectLocatorFailureReason
.NoProjectFileFound
1427
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);
117
throw new ProjectLocatorException("multiple",
ProjectLocatorFailureReason
.MultipleProjectFilesFound)
154
throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable,
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable)
188
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)
1247
throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
1252
throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
1257
throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
1262
throw new Aspire.Cli.Projects.ProjectLocatorException("Project file does not exist.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
1927
throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.NoProjectFileFound);
1932
throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.NoProjectFileFound);
1937
throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.NoProjectFileFound);
1942
throw new Aspire.Cli.Projects.ProjectLocatorException("No project file found.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.NoProjectFileFound);
1952
throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.MultipleProjectFilesFound);
1957
throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.MultipleProjectFilesFound);
1962
throw new Aspire.Cli.Projects.ProjectLocatorException("Multiple project files found.", Aspire.Cli.Projects.
ProjectLocatorFailureReason
.MultipleProjectFilesFound);
1967
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)
262
throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.NoProjectFileFound);
1327
throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.NoProjectFileFound);
1417
throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.NoProjectFileFound);
Projects\ProjectLocatorTests.cs (11)
648
Assert.Equal(
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable, ex.FailureReason);
679
Assert.Equal(
ProjectLocatorFailureReason
.ProjectFileDoesntExist, ex.FailureReason);
711
Assert.Equal(
ProjectLocatorFailureReason
.ProjectFileDoesntExist, ex.FailureReason);
949
var exception = new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.NoProjectFileFound);
1279
Assert.Equal(
ProjectLocatorFailureReason
.UnsupportedProjects, exception.FailureReason);
2365
Assert.Equal(
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable, ex.FailureReason);
2412
Assert.Equal(
ProjectLocatorFailureReason
.ProjectFileDoesntExist, ex.FailureReason);
2540
Assert.Equal(
ProjectLocatorFailureReason
.ProjectFileDoesntExist, ex.FailureReason);
3109
Assert.Equal(
ProjectLocatorFailureReason
.MultipleProjectFilesFound, ex.FailureReason);
3156
Assert.Equal(
ProjectLocatorFailureReason
.MultipleProjectFilesFound, ex.FailureReason);
3212
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);