# DotnetProjectResource

- Kind: `class`
- Package: [Aspire.Hosting.Dotnet](/reference/api/csharp/aspire.hosting.dotnet.md)
- Version: `17.0.0`
- Namespace: `Aspire.Hosting.Dotnet`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/2d325b13709752ba6d9a943635c5e2940a2530c0/src/Aspire.Hosting.Dotnet/DotnetProjectResource.cs)
- Inherits: `ExecutableResource`
- Implements: `IContainerFilesDestinationResource`, `IDotnetProgramResource`, `IResource`, `IResourceWithEndpoints`, `IResourceWithServiceDiscovery`

A resource that represents an SDK-style .NET project or file-based C# app added by path.

## Definition

```csharp
namespace Aspire.Hosting.Dotnet;

public class DotnetProjectResource
    : Aspire.Hosting.ApplicationModel.ExecutableResource,
      Aspire.Hosting.ApplicationModel.IContainerFilesDestinationResource,
      Aspire.Hosting.ApplicationModel.IDotnetProgramResource,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithEndpoints,
      Aspire.Hosting.IResourceWithServiceDiscovery
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting.Dotnet/DotnetProjectResource`
- Public instance properties are exported as ATS capabilities.

## Remarks

A [DotnetProjectResource](/reference/api/csharp/aspire.hosting.dotnet/dotnetprojectresource.md) is added by path and is launched as an executable: `dotnet run --project <path>` for a project file, or `dotnet run --file <path>` for a file-based app (a `.cs` file).

Supported project files are `.csproj`, `.fsproj`, and `.vbproj`. F# scripts and non-SDK project systems are not supported.

Resources created by `AddDotnetProject` support the same .NET SDK container-publishing pipeline as resources created by `AddProject`. A directly constructed resource must be given project metadata and explicitly configured for publishing by its builder.

## Constructors

- [DotnetProjectResource(string, string)](/reference/api/csharp/aspire.hosting.dotnet/dotnetprojectresource/constructors.md#constructor-string-string) -- Initializes a new instance of the [DotnetProjectResource](/reference/api/csharp/aspire.hosting.dotnet/dotnetprojectresource.md) class.
