Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,22 @@ await builder.build().run();

The resource is added as an [`ExecutableResource`](/app-host/executable-resources/) rather than a `ProjectResource`, so it doesn't need to be referenced from the AppHost's own solution. Before the resource starts, Aspire validates that the path resolves to a `.csproj` or `.cs` file (or a directory containing a single `.csproj`) and, for file-based apps, that the active .NET SDK version is 10 or later.

## Publishing

Automatic project publishing for `DotnetProjectResource` isn't currently supported. A plain
`DotnetProjectResource` causes `aspire publish` and `aspire deploy` to fail with an actionable error
instead of emitting an `executable.v0` manifest containing machine-local paths.
Comment thread
karolz-ms marked this conversation as resolved.

Use one of these alternatives:

- Use `AddProject<TProject>(...)` for a project referenced by a C# AppHost.
- Use `AddCSharpApp(...)` / `addCSharpApp(...)` for a path-based project or file-based app that
should use standard .NET project publishing.
- Call `PublishAsDockerFile(...)` / `publishAsDockerFile(...)` to configure container publishing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we mention that this requires an existing Dockerfile in the project directory? PublishAsDockerFile() configures a Dockerfile build; without one this alternative just moves the user to another publish failure.

explicitly.
- Call `ExcludeFromManifest()` / `excludeFromManifest()` when the resource is intentionally
available only during local orchestration.

## See also

- [.NET documentation](https://learn.microsoft.com/dotnet/)
Expand Down
Loading