# DotnetProjectResource

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

A resource that represents a specified C# project or file-based app added by path.

## Definition

```csharp
namespace Aspire.Hosting.Dotnet;

public class DotnetProjectResource
    : Aspire.Hosting.ApplicationModel.ExecutableResource,
      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).

Automatic publishing is not supported. Use `AddProject<TProject>(...)` or `AddCSharpApp(...)` for standard .NET project publishing, explicitly configure container publishing with `PublishAsDockerFile(...)`, or exclude an intentionally run-only resource with `ExcludeFromManifest()`.

## 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.
