130 references to ProjectResource
Aspire.Hosting (55)
ApplicationModel\ProjectResourceExtensions.cs (4)
7
/// Provides extension methods for <see cref="DistributedApplicationModel"/> to work with <see cref="
ProjectResource
"/> instances.
16
public static IEnumerable<
ProjectResource
> GetProjectResources(this DistributedApplicationModel model)
20
return model.Resources.OfType<
ProjectResource
>();
29
public static IProjectMetadata GetProjectMetadata(this
ProjectResource
projectResource)
BuiltInDistributedApplicationEventSubscriptionHandlers.cs (1)
28
foreach (
var
project in beforeStartEvent.Model.GetProjectResources())
Dashboard\DashboardLifecycleHook.cs (1)
169
ProjectResource
=> KnownResourceTypes.Project,
Dcp\DcpExecutor.cs (4)
411
Executable => appModelResource is
ProjectResource
? KnownResourceTypes.Project : KnownResourceTypes.Executable,
824
foreach (
var
project in modelProjectResources)
939
var resourceType = resource is
ProjectResource
? KnownResourceTypes.Project : KnownResourceTypes.Executable;
1060
if (er.ModelResource is
ProjectResource
project)
Dcp\DcpNameGenerator.cs (1)
45
else if (resource is
ProjectResource
)
Dcp\ResourceSnapshotBuilder.cs (1)
97
projectPath = appModelResource is
ProjectResource
p ? p.GetProjectMetadata().ProjectPath : null;
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)
61
public static IResourceBuilder<
ProjectResource
> AddProject<TProject>(this IDistributedApplicationBuilder builder, [ResourceName] string name) where TProject : IProjectMetadata, new()
94
public static IResourceBuilder<
ProjectResource
> AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath)
141
public static IResourceBuilder<
ProjectResource
> AddProject<TProject>(this IDistributedApplicationBuilder builder, [ResourceName] string name, string? launchProfileName) where TProject : IProjectMetadata, new()
179
public static IResourceBuilder<
ProjectResource
> AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath, string? launchProfileName)
228
public static IResourceBuilder<
ProjectResource
> AddProject<TProject>(this IDistributedApplicationBuilder builder, [ResourceName] string name, Action<ProjectResourceOptions> configure) where TProject : IProjectMetadata, new()
237
var
project = new ProjectResource(name);
268
public static IResourceBuilder<
ProjectResource
> AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath, Action<ProjectResourceOptions> configure)
278
var
project = new ProjectResource(name);
287
private static IResourceBuilder<
ProjectResource
> WithProjectDefaults(this IResourceBuilder<
ProjectResource
> builder, ProjectResourceOptions options)
309
var
projectResource = builder.Resource;
579
/// reverse proxy for each process. When <see cref="WithReplicas(IResourceBuilder{
ProjectResource
}, int)"/> is
596
public static IResourceBuilder<
ProjectResource
> WithReplicas(this IResourceBuilder<
ProjectResource
> builder, int replicas)
617
/// into the project and set to true. If the <see cref="DisableForwardedHeaders(IResourceBuilder{
ProjectResource
})"/>
630
public static IResourceBuilder<
ProjectResource
> DisableForwardedHeaders(this IResourceBuilder<
ProjectResource
> builder)
645
public static IResourceBuilder<
ProjectResource
> WithEndpointsInEnvironment(
646
this IResourceBuilder<
ProjectResource
> builder, Func<EndpointAnnotation, bool> filter)
657
/// Adds support for containerizing this <see cref="
ProjectResource
"/> during deployment.
671
where T :
ProjectResource
709
private static IConfiguration GetConfiguration(
ProjectResource
projectResource)
730
private static void SetAspNetCoreUrls(this IResourceBuilder<
ProjectResource
> builder)
777
private static void SetBothPortsEnvVariables(this IResourceBuilder<
ProjectResource
> builder)
786
private static void SetOnePortsEnvVariable(this IResourceBuilder<
ProjectResource
> builder, EnvironmentCallbackContext context, string portEnvVariable, string scheme)
821
private static void SetKestrelUrlOverrideEnvVariables(this IResourceBuilder<
ProjectResource
> builder)
852
private sealed class ProjectContainerResource(
ProjectResource
pr) : ContainerResource(pr.Name)
Publishing\ManifestPublishingContext.cs (4)
105
else if (resource is
ProjectResource
project)
149
private async Task WriteProjectAsync(
ProjectResource
project)
426
(
ProjectResource
project, string uriScheme, null, _) when IsHttpScheme(uriScheme) && !httpSchemesEncountered.Contains(uriScheme) => null,
434
if (resource is
ProjectResource
&& IsHttpScheme(endpoint.UriScheme))
Publishing\ResourceContainerImageBuilder.cs (1)
40
if (resource is
ProjectResource
)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (8)
14
internal static LaunchSettings? GetLaunchSettings(this
ProjectResource
projectResource)
31
internal static NamedLaunchProfile? GetEffectiveLaunchProfile(this
ProjectResource
projectResource, bool throwIfNotFound = false)
48
internal static LaunchProfile? GetLaunchProfile(this
ProjectResource
projectResource, string launchProfileName, bool throwIfNotFound = false)
115
private static bool TrySelectLaunchProfileByOrder(
ProjectResource
projectResource, [NotNullWhen(true)] out string? launchProfileName)
129
private static bool TrySelectLaunchProfileFromDefaultAnnotation(
ProjectResource
projectResource, [NotNullWhen(true)] out string? launchProfileName)
155
private static bool TrySelectLaunchProfileFromAnnotation(
ProjectResource
projectResource, [NotNullWhen(true)] out string? launchProfileName)
169
internal static string? SelectLaunchProfileName(this
ProjectResource
projectResource)
191
internal delegate bool LaunchProfileSelector(
ProjectResource
project, out string? launchProfile);
Aspire.Hosting.Azure (1)
AzureResourcePreparer.cs (1)
133
if (!resource.IsContainer() && resource is not
ProjectResource
)
Aspire.Hosting.Azure.AppContainers (5)
AzureContainerAppProjectExtensions.cs (1)
35
where T :
ProjectResource
AzureContainerAppsInfrastructure.cs (1)
52
if (!r.IsContainer() && r is not
ProjectResource
)
ContainerAppContext.cs (3)
229
(
ProjectResource
project, string uriScheme, null, _) when IsHttpScheme(uriScheme) && !httpSchemesEncountered.Contains(uriScheme) => null,
237
if (resource is
ProjectResource
&& IsHttpScheme(endpoint.UriScheme))
339
var targetPort = httpIngress.Port ?? (resource is
ProjectResource
? null : 80);
Aspire.Hosting.Azure.Functions (8)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (8)
14
internal static LaunchSettings? GetLaunchSettings(this
ProjectResource
projectResource)
31
internal static NamedLaunchProfile? GetEffectiveLaunchProfile(this
ProjectResource
projectResource, bool throwIfNotFound = false)
48
internal static LaunchProfile? GetLaunchProfile(this
ProjectResource
projectResource, string launchProfileName, bool throwIfNotFound = false)
115
private static bool TrySelectLaunchProfileByOrder(
ProjectResource
projectResource, [NotNullWhen(true)] out string? launchProfileName)
129
private static bool TrySelectLaunchProfileFromDefaultAnnotation(
ProjectResource
projectResource, [NotNullWhen(true)] out string? launchProfileName)
155
private static bool TrySelectLaunchProfileFromAnnotation(
ProjectResource
projectResource, [NotNullWhen(true)] out string? launchProfileName)
169
internal static string? SelectLaunchProfileName(this
ProjectResource
projectResource)
191
internal delegate bool LaunchProfileSelector(
ProjectResource
project, out string? launchProfile);
Aspire.Hosting.Azure.Tests (9)
AzureContainerAppsTests.cs (7)
220
var
container = Assert.Single(model.GetProjectResources());
779
var
proj = Assert.Single(model.GetProjectResources());
1117
var
proj = Assert.Single(model.GetProjectResources());
2303
var
project = Assert.Single(model.GetProjectResources());
2442
var
project = Assert.Single(model.GetProjectResources());
2646
var
project = Assert.Single(model.GetProjectResources());
2859
var
project = Assert.Single(model.GetProjectResources());
ContainerRegistryTests.cs (1)
61
var
project = Assert.Single(model.GetProjectResources());
PublicApiTests\AppContainersPublicApiTests.cs (1)
94
IResourceBuilder<
ProjectResource
> project = null!;
Aspire.Hosting.Docker (3)
DockerComposeInfrastructure.cs (1)
50
if (!r.IsContainer() && r is not
ProjectResource
)
DockerComposeServiceResource.cs (2)
97
if (resourceInstance.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _) || resourceInstance is
ProjectResource
)
138
if (waitAnnotation.Resource is
ProjectResource
|| waitAnnotation.Resource.IsContainer())
Aspire.Hosting.Kubernetes (3)
KubernetesInfrastructure.cs (1)
50
if (!r.IsContainer() && r is not
ProjectResource
)
KubernetesResource.cs (2)
131
if (!resourceInstance.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _) && resourceInstance is not
ProjectResource
)
167
if (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)
524
var project = builder.CreateResourceBuilder<
ProjectResource
>("mywebapp1");
Aspire.Hosting.Tests (31)
Dashboard\DashboardResourceTests.cs (2)
525
var
dashboard = Assert.Single(model.Resources.OfType<
ProjectResource
>());
Dcp\DcpExecutorTests.cs (2)
55
var
resource = builder.AddProject<Projects.ServiceA>("ServiceA")
174
var
resource = builder.AddProject<Projects.ServiceA>("ServiceA")
KestrelConfigTests.cs (12)
17
var
resource = CreateTestProjectResource<ProjectWithProfileEndpointAndKestrelHttpEndpoint>(
53
var
resource = CreateTestProjectResource<ProjectWithProfileEndpointAndKestrelHttpEndpoint>(
91
var
resource = CreateTestProjectResource<ProjectWithKestrelHttpsEndpoint>(operation: DistributedApplicationOperation.Run);
108
var
resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>(operation: DistributedApplicationOperation.Run);
134
var
resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>(
175
var
resource = CreateTestProjectResource<ProjectWithOnlyKestrelHttpEndpoint>();
213
var
resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>(
280
var
resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>(
311
var
resource = CreateTestProjectResource<ProjectWithKestrelEndpointsLevelProtocols>(
348
private static
ProjectResource
CreateTestProjectResource<TProject>(
350
Action<IResourceBuilder<
ProjectResource
>>? callback = null,
459
private static void AllocateTestEndpoints(
ProjectResource
resource)
ProjectResourceTests.cs (15)
74
var
resource = Assert.Single(projectResources);
188
var
resource = Assert.Single(projectResources);
216
var
resource = Assert.Single(projectResources);
234
var
resource = Assert.Single(projectResources);
250
var
resource = Assert.Single(projectResources);
298
var
resource = Assert.Single(projectResources);
318
var
resource = Assert.Single(projectResources);
361
var
resource = Assert.Single(projectResources);
383
var
resource = Assert.Single(projectResources);
408
var
resource = Assert.Single(projectResources);
436
var
resource = Assert.Single(projectResources);
457
var
resource = Assert.Single(projectResources);
481
var
resource = Assert.Single(projectResources);
531
var
resource = Assert.Single(projectResources);
625
var
resource = Assert.Single(projectResources);
Aspire.Playground.Tests (5)
AppHostTests.cs (1)
39
var projects = appHost.Resources.OfType<
ProjectResource
>();
Infrastructure\DistributedApplicationExtensions.cs (2)
145
(
ProjectResource
or ExecutableResource)
207
public 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.
13
public static string GetName(this
ProjectResource
project)
TestProject.AppHost (8)
TestProgram.cs (8)
123
public IResourceBuilder<
ProjectResource
> ServiceABuilder { get; private set; }
124
public IResourceBuilder<
ProjectResource
> ServiceBBuilder { get; private set; }
125
public IResourceBuilder<
ProjectResource
> ServiceCBuilder { get; private set; }
126
public IResourceBuilder<
ProjectResource
> WorkerABuilder { get; private set; }
127
public IResourceBuilder<
ProjectResource
>? IntegrationServiceABuilder { get; private set; }
130
public List<IResourceBuilder<
ProjectResource
>> ServiceProjectBuilders => [ServiceABuilder, ServiceBBuilder, ServiceCBuilder];
160
foreach (
var
project in appModel.Resources.OfType<
ProjectResource
>())