72 references to ProjectLocatorFailureReason
aspire (29)
Commands\RestoreCommand.cs (2)
82
catch (ProjectLocatorException ex) when (ex.FailureReason is
ProjectLocatorFailureReason
.NoProjectFileFound or
ProjectLocatorFailureReason
.ProjectFileDoesntExist)
Commands\UpdateCommand.cs (4)
195
catch (ProjectLocatorException ex) when (ex.FailureReason is
ProjectLocatorFailureReason
.NoProjectFileFound or
ProjectLocatorFailureReason
.ProjectFileDoesntExist)
278
catch (ProjectLocatorException ex) when (passedAppHostProjectFile is null && ex.FailureReason ==
ProjectLocatorFailureReason
.NoProjectFileFound)
518
if (ex.FailureReason ==
ProjectLocatorFailureReason
.NoProjectFileFound)
Projects\ProjectLocator.cs (21)
953
throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable,
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable);
958
throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.UnsupportedProjects);
962
throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist,
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
990
throw new ProjectLocatorException(ErrorStrings.MultipleProjectFilesFound,
ProjectLocatorFailureReason
.MultipleProjectFilesFound);
1020
throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist,
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
1070
throw new ProjectLocatorException(ErrorStrings.ProjectFileDoesntExist,
ProjectLocatorFailureReason
.ProjectFileDoesntExist);
1114
throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.UnsupportedProjects);
1118
throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.NoProjectFileFound);
1129
throw new ProjectLocatorException(ErrorStrings.AppHostsMayNotBeBuildable,
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable);
1167
MultipleAppHostProjectsFoundBehavior.Throw => throw new ProjectLocatorException(ErrorStrings.MultipleProjectFilesFound,
ProjectLocatorFailureReason
.MultipleProjectFilesFound),
1401
internal class ProjectLocatorException(string message,
ProjectLocatorFailureReason
failureReason) : System.Exception(message)
1403
public
ProjectLocatorFailureReason
FailureReason { get; } = failureReason;
1414
ProjectLocatorFailureReason
.MultipleProjectFilesFound when projectOptionSpecifiedAsDirectory
1416
ProjectLocatorFailureReason
.ProjectFileDoesntExist or
ProjectLocatorFailureReason
.NoProjectFileFound when projectOptionSpecifiedAsDirectory
1418
ProjectLocatorFailureReason
.UnsupportedProjects
1420
ProjectLocatorFailureReason
.ProjectFileNotAppHostProject
1422
ProjectLocatorFailureReason
.ProjectFileDoesntExist
1424
ProjectLocatorFailureReason
.MultipleProjectFilesFound
1426
ProjectLocatorFailureReason
.NoProjectFileFound
1428
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable
Utils\EnvironmentChecker\AspireVersionCheck.cs (2)
226
catch (ProjectLocatorException ex) when (ex.FailureReason is
ProjectLocatorFailureReason
.NoProjectFileFound or
ProjectLocatorFailureReason
.ProjectFileDoesntExist)
Aspire.Cli.Tests (43)
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)
46
: throw new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.NoProjectFileFound)
205
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 (11)
676
Assert.Equal(
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable, ex.FailureReason);
707
Assert.Equal(
ProjectLocatorFailureReason
.ProjectFileDoesntExist, ex.FailureReason);
739
Assert.Equal(
ProjectLocatorFailureReason
.ProjectFileDoesntExist, ex.FailureReason);
977
var exception = new ProjectLocatorException(ErrorStrings.NoProjectFileFound,
ProjectLocatorFailureReason
.NoProjectFileFound);
1307
Assert.Equal(
ProjectLocatorFailureReason
.UnsupportedProjects, exception.FailureReason);
2429
Assert.Equal(
ProjectLocatorFailureReason
.AppHostsMayNotBeBuildable, ex.FailureReason);
2476
Assert.Equal(
ProjectLocatorFailureReason
.ProjectFileDoesntExist, ex.FailureReason);
2604
Assert.Equal(
ProjectLocatorFailureReason
.ProjectFileDoesntExist, ex.FailureReason);
3193
Assert.Equal(
ProjectLocatorFailureReason
.MultipleProjectFilesFound, ex.FailureReason);
3240
Assert.Equal(
ProjectLocatorFailureReason
.MultipleProjectFilesFound, ex.FailureReason);
3296
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);