# DotnetProjectResource.WithEndpointsInEnvironment

- Module: [Aspire.Hosting.Dotnet](/reference/api/go/aspire.hosting.dotnet.md)
- Defined on: [DotnetProjectResource](/reference/api/go/aspire.hosting.dotnet/dotnetprojectresource.md)
- Version: `17.0.0`
- Kind: `method`

Configures endpoint environment-variable injection for a .NET project in polyglot AppHosts.

## Definition

```go
type DotnetProjectResource interface {
    // ... omitted for brevity
    WithEndpointsInEnvironment(endpointNames []string) DotnetProjectResource
}
```

## Signature

```go
WithEndpointsInEnvironment(endpointNames []string) DotnetProjectResource
```

## Parameters

- `endpointNames` (`[]string`)

## Returns

[`DotnetProjectResource`](/reference/api/go/aspire.hosting.dotnet/dotnetprojectresource.md)

Returns a handle; failures surface later via `Err()`.

## Defined on

- [DotnetProjectResource](/reference/api/go/aspire.hosting.dotnet/dotnetprojectresource.md) -- `handle`
