Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion src/Aspire.Hosting/DistributedApplicationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ private DistributedApplicationExecutionContextOptions BuildExecutionContextOptio
{
DistributedApplicationOperation.Run => new DistributedApplicationExecutionContextOptions(operation),
DistributedApplicationOperation.Inspect => new DistributedApplicationExecutionContextOptions(operation),
_ => new DistributedApplicationExecutionContextOptions(operation, _innerBuilder.Configuration["Publishing:Publisher"])
DistributedApplicationOperation.Publish => new DistributedApplicationExecutionContextOptions(operation, _innerBuilder.Configuration["Publishing:Publisher"] ?? "manifest"),
_ => throw new DistributedApplicationException("Invalid operation specified. Valid operations are 'publish', 'inspect', or 'run'.")
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public DistributedApplicationExecutionContext(DistributedApplicationOperation op
/// <summary>
/// The name of the publisher that is being used if <see cref="Operation"/> is set to <see cref="DistributedApplicationOperation.Publish"/>.
/// </summary>
public string? PublisherName { get; set; }
public string PublisherName { get; set; }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mitchdenny This one was not sure but since there is no way to pass a null values from the ctors. Unless we expect someone to set the value afterwards.

Copy link
Member

Choose a reason for hiding this comment

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

If you don't pass a publisher name then it is null - which is valid if you are not in publisher mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

public DistributedApplicationExecutionContext(DistributedApplicationOperation operation) : this(operation, "manifest")

won't be null, right?


private readonly DistributedApplicationExecutionContextOptions? _options;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ public class DistributedApplicationExecutionContextOptions
/// Constructs a <see cref="DistributedApplicationExecutionContextOptions" />.
/// </summary>
/// <param name="operation">Indicates whether the AppHost is running in Publish mode or Run mode.</param>
public DistributedApplicationExecutionContextOptions(DistributedApplicationOperation operation) : this(operation, null)
public DistributedApplicationExecutionContextOptions(DistributedApplicationOperation operation)
{
this.Operation = operation;
}

/// <summary>
/// Constructs a <see cref="DistributedApplicationExecutionContextOptions" />.
/// </summary>
/// <param name="operation">Indicates whether the AppHost is running in Publish mode or Run mode.</param>
/// <param name="publisherName">The publisher name if in Publish mode.</param>
public DistributedApplicationExecutionContextOptions(DistributedApplicationOperation operation, string? publisherName = null)
public DistributedApplicationExecutionContextOptions(DistributedApplicationOperation operation, string publisherName)
{
this.Operation = operation;
this.PublisherName = publisherName;
Expand All @@ -38,7 +39,7 @@ public DistributedApplicationExecutionContextOptions(DistributedApplicationOpera
public DistributedApplicationOperation Operation { get; }

/// <summary>
/// The name of the publisher if running in pbublish mode.
/// The name of the publisher if running in publish mode.
/// </summary>
public string? PublisherName { get; }
}
Loading