# ProjectResource

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Version: `17.0.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

A resource that represents a specified .NET project.

## Definition

```go
type ProjectResource interface {
    DotnetProgramResource
    IComputeResource
    IContainerFilesDestinationResource
    Resource
    ResourceWithArgs
    ResourceWithEndpoints
    ResourceWithEnvironment
    ResourceWithWaitSupport
}
```

## Embeds

- [`DotnetProgramResource`](/reference/api/go/aspire.hosting/dotnetprogramresource.md)
- [`IComputeResource`](/reference/api/go/aspire.hosting/icomputeresource.md)
- [`IContainerFilesDestinationResource`](/reference/api/go/aspire.hosting/icontainerfilesdestinationresource.md)
- [`Resource`](/reference/api/go/aspire.hosting/resource.md)
- [`ResourceWithArgs`](/reference/api/go/aspire.hosting/resourcewithargs.md)
- [`ResourceWithEndpoints`](/reference/api/go/aspire.hosting/resourcewithendpoints.md)
- [`ResourceWithEnvironment`](/reference/api/go/aspire.hosting/resourcewithenvironment.md)
- [`ResourceWithWaitSupport`](/reference/api/go/aspire.hosting/resourcewithwaitsupport.md)

## Methods

- [DisableForwardedHeaders](/reference/api/go/aspire.hosting/projectresource/disableforwardedheaders.md) -- `method` -- Configures the project to disable forwarded headers when being published.
  ```go
  DisableForwardedHeaders() ProjectResource
  ```
- [PublishAsDockerFile](/reference/api/go/aspire.hosting/projectresource/publishasdockerfile.md) -- `method` -- Publishes a project as a Docker file with optional container configuration
  ```go
  PublishAsDockerFile(options ...*PublishAsDockerFileOptions) ProjectResource
  ```
- [WithEndpointsInEnvironment](/reference/api/go/aspire.hosting/projectresource/withendpointsinenvironment.md) -- `method` -- Includes only the specified project endpoint names in environment-variable injection.
  ```go
  WithEndpointsInEnvironment(endpointNames []string) ProjectResource
  ```
- [WithReplicas](/reference/api/go/aspire.hosting/projectresource/withreplicas.md) -- `method` -- Configures how many replicas of the project should be created for the project.
  ```go
  WithReplicas(replicas float64) ProjectResource
  ```
- [WithVolume](/reference/api/go/aspire.hosting/projectresource/withvolume.md) -- `method` -- Adds a volume to a project resource.
  ```go
  WithVolume(target string, name string, env string, options ...*ProjectResourceWithVolumeOptions) ProjectResource
  ```
