75 references to ProjectLocatorFailureReason
aspire (32)
Commands\RestoreCommand.cs (2)
82
catch (ProjectLocatorException ex) when (ex.FailureReason is
ProjectLocatorFailureReason
.NoProjectFileFound or
ProjectLocatorFailureReason
.ProjectFileDoesntExist)
Commands\UpdateCommand.cs (7)
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)
567
if (ex.FailureReason ==
ProjectLocatorFailureReason
.NoProjectFileFound)
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 (21)
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),
1449
internal class ProjectLocatorException(string message,
ProjectLocatorFailureReason
failureReason) : System.Exception(message)
1451
public
ProjectLocatorFailureReason
FailureReason { get; } = failureReason;
1462
ProjectLocatorFailureReason
.MultipleProjectFilesFound when projectOptionSpecifiedAsDirectory
1464
ProjectLocatorFailureReason
.ProjectFileDoesntExist or
ProjectLocatorFailureReason
.NoProjectFileFound when projectOptionSpecifiedAsDirectory
1466
ProjectLocatorFailureReason
.UnsupportedProjects
1468
ProjectLocatorFailureReason
.ProjectFileNotAppHostProject
1470
ProjectLocatorFailureReason
.ProjectFileDoesntExist
1472
ProjectLocatorFailureReason
.MultipleProjectFilesFound
1474
ProjectLocatorFailureReason
.NoProjectFileFound
1476
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)
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 (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);