2 types derived from ProjectResource
Aspire.Hosting.Azure.Functions (1)
AzureFunctionsResource.cs (1)
17public class AzureFunctionsProjectResource(string name) : ProjectResource(name)
Aspire.Hosting.Tests (1)
Backchannel\Exec\ProjectResourceExecTests.cs (1)
138file sealed class TestProjectResource : ProjectResource
2 instantiations of ProjectResource
Aspire.Hosting (2)
ProjectResourceBuilderExtensions.cs (2)
237var project = new ProjectResource(name); 278var project = new ProjectResource(name);
143 references to ProjectResource
Aspire.Hosting (58)
ApplicationModel\DistributedApplicationModelExtensions.cs (1)
26if (!r.IsContainer() && !r.IsEmulator() && r is not ProjectResource)
ApplicationModel\ProjectResourceExtensions.cs (4)
7/// Provides extension methods for <see cref="DistributedApplicationModel"/> to work with <see cref="ProjectResource"/> instances. 16public static IEnumerable<ProjectResource> GetProjectResources(this DistributedApplicationModel model) 20return model.Resources.OfType<ProjectResource>(); 29public static IProjectMetadata GetProjectMetadata(this ProjectResource projectResource)
BuiltInDistributedApplicationEventSubscriptionHandlers.cs (1)
33foreach (var project in beforeStartEvent.Model.GetProjectResources())
Dashboard\DashboardLifecycleHook.cs (1)
217ProjectResource => KnownResourceTypes.Project,
Dcp\DcpExecutor.cs (4)
486Executable => appModelResource is ProjectResource ? KnownResourceTypes.Project : KnownResourceTypes.Executable, 976foreach (var project in modelProjectResources) 1090var resourceType = resource is ProjectResource ? KnownResourceTypes.Project : KnownResourceTypes.Executable; 1251if (er.ModelResource is ProjectResource project)
Dcp\DcpNameGenerator.cs (1)
45else if (resource is ProjectResource)
Dcp\ResourceSnapshotBuilder.cs (1)
136projectPath = appModelResource is ProjectResource p ? p.GetProjectMetadata().ProjectPath : null;
Exec\ExecResourceManager.cs (2)
190ProjectResource prj => BuildAgainstResource(prj), 196private IResource BuildAgainstResource(ProjectResource project)
LaunchProfile.cs (1)
9/// Represents a launch profile for a <see cref="Aspire.Hosting.ApplicationModel.ProjectResource"/>.
LaunchSettings.cs (2)
9/// Represents the launch settings for a <see cref="ApplicationModel.ProjectResource"/>. 14/// Gets or sets the collection of named launch profiles associated with the <see cref="ApplicationModel.ProjectResource"/>.
ProjectResourceBuilderExtensions.cs (27)
61public static IResourceBuilder<ProjectResource> AddProject<TProject>(this IDistributedApplicationBuilder builder, [ResourceName] string name) where TProject : IProjectMetadata, new() 94public static IResourceBuilder<ProjectResource> AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath) 141public static IResourceBuilder<ProjectResource> AddProject<TProject>(this IDistributedApplicationBuilder builder, [ResourceName] string name, string? launchProfileName) where TProject : IProjectMetadata, new() 179public static IResourceBuilder<ProjectResource> AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath, string? launchProfileName) 228public static IResourceBuilder<ProjectResource> AddProject<TProject>(this IDistributedApplicationBuilder builder, [ResourceName] string name, Action<ProjectResourceOptions> configure) where TProject : IProjectMetadata, new() 237var project = new ProjectResource(name); 268public static IResourceBuilder<ProjectResource> AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath, Action<ProjectResourceOptions> configure) 278var project = new ProjectResource(name); 287private static IResourceBuilder<ProjectResource> WithProjectDefaults(this IResourceBuilder<ProjectResource> builder, ProjectResourceOptions options) 309var projectResource = builder.Resource; 580/// reverse proxy for each process. When <see cref="WithReplicas(IResourceBuilder{ProjectResource}, int)"/> is 597public static IResourceBuilder<ProjectResource> WithReplicas(this IResourceBuilder<ProjectResource> builder, int replicas) 618/// into the project and set to true. If the <see cref="DisableForwardedHeaders(IResourceBuilder{ProjectResource})"/> 631public static IResourceBuilder<ProjectResource> DisableForwardedHeaders(this IResourceBuilder<ProjectResource> builder) 646public static IResourceBuilder<ProjectResource> WithEndpointsInEnvironment( 647this IResourceBuilder<ProjectResource> builder, Func<EndpointAnnotation, bool> filter) 658/// Adds support for containerizing this <see cref="ProjectResource"/> during deployment. 672where T : ProjectResource 710private static IConfiguration GetConfiguration(ProjectResource projectResource) 731private static void SetAspNetCoreUrls(this IResourceBuilder<ProjectResource> builder) 775private static void SetBothPortsEnvVariables(this IResourceBuilder<ProjectResource> builder) 784private static void SetOnePortsEnvVariable(this IResourceBuilder<ProjectResource> builder, EnvironmentCallbackContext context, string portEnvVariable, string scheme) 819private static void SetKestrelUrlOverrideEnvVariables(this IResourceBuilder<ProjectResource> builder) 860private sealed class ProjectContainerResource(ProjectResource pr) : ContainerResource(pr.Name)
Publishing\ManifestPublishingContext.cs (4)
105else if (resource is ProjectResource project) 149private async Task WriteProjectAsync(ProjectResource project) 426(ProjectResource project, string uriScheme, null, _) when IsHttpScheme(uriScheme) && !httpSchemesEncountered.Contains(uriScheme) => null, 434if (resource is ProjectResource && IsHttpScheme(endpoint.UriScheme))
Publishing\ResourceContainerImageBuilder.cs (1)
185if (resource is ProjectResource)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (8)
14internal static LaunchSettings? GetLaunchSettings(this ProjectResource projectResource) 31internal static NamedLaunchProfile? GetEffectiveLaunchProfile(this ProjectResource projectResource, bool throwIfNotFound = false) 48internal static LaunchProfile? GetLaunchProfile(this ProjectResource projectResource, string launchProfileName, bool throwIfNotFound = false) 115private static bool TrySelectLaunchProfileByOrder(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 129private static bool TrySelectLaunchProfileFromDefaultAnnotation(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 155private static bool TrySelectLaunchProfileFromAnnotation(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 169internal static string? SelectLaunchProfileName(this ProjectResource projectResource) 191internal delegate bool LaunchProfileSelector(ProjectResource project, out string? launchProfile);
Aspire.Hosting.Azure (1)
AzureResourcePreparer.cs (1)
240return resource.IsContainer() || resource is ProjectResource || resource is AzureUserAssignedIdentityResource;
Aspire.Hosting.Azure.AppContainers (5)
AzureContainerAppProjectExtensions.cs (1)
35where T : ProjectResource
ContainerAppContext.cs (4)
143if (resource is ProjectResource) 267(ProjectResource project, string uriScheme, null, _) when IsHttpScheme(uriScheme) && !httpSchemesEncountered.Contains(uriScheme) => null, 275if (resource is ProjectResource && IsHttpScheme(endpoint.UriScheme)) 377var targetPort = httpIngress.Port ?? (resource is ProjectResource ? null : 80);
Aspire.Hosting.Azure.AppService (1)
AzureAppServiceInfrastructure.cs (1)
42if (resource is not ProjectResource && !(resource.IsContainer() && resource.TryGetAnnotationsOfType<DockerfileBuildAnnotation>(out _)))
Aspire.Hosting.Azure.Functions (8)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (8)
14internal static LaunchSettings? GetLaunchSettings(this ProjectResource projectResource) 31internal static NamedLaunchProfile? GetEffectiveLaunchProfile(this ProjectResource projectResource, bool throwIfNotFound = false) 48internal static LaunchProfile? GetLaunchProfile(this ProjectResource projectResource, string launchProfileName, bool throwIfNotFound = false) 115private static bool TrySelectLaunchProfileByOrder(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 129private static bool TrySelectLaunchProfileFromDefaultAnnotation(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 155private static bool TrySelectLaunchProfileFromAnnotation(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 169internal static string? SelectLaunchProfileName(this ProjectResource projectResource) 191internal delegate bool LaunchProfileSelector(ProjectResource project, out string? launchProfile);
Aspire.Hosting.Azure.Tests (16)
AzureAppServiceTests.cs (2)
93var container = Assert.Single(model.GetProjectResources()); 232var project = Assert.Single(model.GetProjectResources());
AzureContainerAppsTests.cs (8)
321var proj = Assert.Single(model.GetProjectResources()); 398var proj = Assert.Single(model.GetProjectResources()); 901var project = Assert.Single(model.GetProjectResources()); 938var project = Assert.Single(model.GetProjectResources()); 982var project = Assert.Single(model.GetProjectResources()); 1023var project = Assert.Single(model.GetProjectResources()); 1266var project = Assert.Single(model.GetProjectResources()); 1317var project = Assert.Single(model.GetProjectResources());
AzureUserAssignedIdentityTests.cs (4)
160r => Assert.IsType<ProjectResource>(r), 215r => Assert.IsType<ProjectResource>(r), 291r => Assert.IsType<ProjectResource>(r), 292r => Assert.IsType<ProjectResource>(r),
ContainerRegistryTests.cs (1)
60var project = Assert.Single(model.GetProjectResources());
PublicApiTests\AppContainersPublicApiTests.cs (1)
93IResourceBuilder<ProjectResource> project = null!;
Aspire.Hosting.Docker (3)
DockerComposeEnvironmentContext.cs (1)
55if (serviceResource.TargetResource is ProjectResource)
DockerComposeServiceResource.cs (2)
97if (resourceInstance.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _) || resourceInstance is ProjectResource) 134if (waitAnnotation.Resource is ProjectResource || waitAnnotation.Resource.IsContainer())
Aspire.Hosting.Kubernetes (2)
KubernetesResource.cs (2)
132if (!resourceInstance.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _) && resourceInstance is not ProjectResource) 168if (resource is ProjectResource && endpoint.TargetPort is null)
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
133/// <param name="builder">An <see cref="IResourceBuilder{T}"/> for <see cref="ProjectResource"/></param>
Aspire.Hosting.Testing.Tests (1)
TestingBuilderTests.cs (1)
525var project = builder.CreateResourceBuilder<ProjectResource>("mywebapp1");
Aspire.Hosting.Tests (33)
Dashboard\DashboardResourceTests.cs (2)
536var dashboard = Assert.Single(model.Resources.OfType<ProjectResource>());
Dcp\DcpExecutorTests.cs (2)
57var resource = builder.AddProject<Projects.ServiceA>("ServiceA") 176var resource = builder.AddProject<Projects.ServiceA>("ServiceA")
KestrelConfigTests.cs (12)
16var resource = CreateTestProjectResource<ProjectWithProfileEndpointAndKestrelHttpEndpoint>( 52var resource = CreateTestProjectResource<ProjectWithProfileEndpointAndKestrelHttpEndpoint>( 90var resource = CreateTestProjectResource<ProjectWithKestrelHttpsEndpoint>(operation: DistributedApplicationOperation.Run); 107var resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>(operation: DistributedApplicationOperation.Run); 133var resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>( 174var resource = CreateTestProjectResource<ProjectWithOnlyKestrelHttpEndpoint>(); 212var resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>( 279var resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>( 310var resource = CreateTestProjectResource<ProjectWithKestrelEndpointsLevelProtocols>( 347private static ProjectResource CreateTestProjectResource<TProject>( 349Action<IResourceBuilder<ProjectResource>>? callback = null, 458private static void AllocateTestEndpoints(ProjectResource resource)
ProjectResourceTests.cs (15)
74var resource = Assert.Single(projectResources); 188var resource = Assert.Single(projectResources); 216var resource = Assert.Single(projectResources); 234var resource = Assert.Single(projectResources); 250var resource = Assert.Single(projectResources); 300var resource = Assert.Single(projectResources); 320var resource = Assert.Single(projectResources); 363var resource = Assert.Single(projectResources); 385var resource = Assert.Single(projectResources); 410var resource = Assert.Single(projectResources); 438var resource = Assert.Single(projectResources); 459var resource = Assert.Single(projectResources); 483var resource = Assert.Single(projectResources); 533var resource = Assert.Single(projectResources); 627var resource = Assert.Single(projectResources);
WithEnvironmentTests.cs (2)
417ResourceBuilderExtensions.WithEnvironment<ProjectResource, TestValueAndManifestProvider>(null!, "TEST_VAR", testValue)); 421projectA.WithEnvironment<ProjectResource, TestValueAndManifestProvider>(null!, testValue));
Aspire.Playground.Tests (5)
AppHostTests.cs (1)
39var projects = appHost.Resources.OfType<ProjectResource>();
Infrastructure\DistributedApplicationExtensions.cs (2)
148(ProjectResource or ExecutableResource) 210public static async Task<bool> TryApplyEfMigrationsAsync(this DistributedApplication app, ProjectResource project)
Infrastructure\ResourceExtensions.cs (2)
11/// Gets the name of the <see cref="ProjectResource"/> based on the project file path. 13public static string GetName(this ProjectResource project)
Stress.AppHost (1)
Program.cs (1)
158.Where(r => r.IsContainer() || r is ProjectResource || r is ExecutableResource)
TestProject.AppHost (8)
TestProgram.cs (8)
124public IResourceBuilder<ProjectResource> ServiceABuilder { get; private set; } 125public IResourceBuilder<ProjectResource> ServiceBBuilder { get; private set; } 126public IResourceBuilder<ProjectResource> ServiceCBuilder { get; private set; } 127public IResourceBuilder<ProjectResource> WorkerABuilder { get; private set; } 128public IResourceBuilder<ProjectResource>? IntegrationServiceABuilder { get; private set; } 131public List<IResourceBuilder<ProjectResource>> ServiceProjectBuilders => [ServiceABuilder, ServiceBBuilder, ServiceCBuilder]; 161foreach (var project in appModel.Resources.OfType<ProjectResource>())