Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizable dotnet watch behavior #4855

Closed
Juulsn opened this issue Jul 11, 2024 · 4 comments
Closed

Customizable dotnet watch behavior #4855

Juulsn opened this issue Jul 11, 2024 · 4 comments
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Comments

@Juulsn
Copy link

Juulsn commented Jul 11, 2024

Background and Motivation

The dotnet watch command is an essential tool, especially for people working with non VS IDEs.
However, currently there is no way to modify the command arguments, which do start the process with the dotnet watch command if the DOTNET_WATCH env var is set, but also includes the --no-hot-reload option.
(Added in #515)

Introducing an annotation-based configuration would streamline the process, allowing developers to specify the dotnet watch behavior, especially the hot-reload option.

Proposed API

+ public sealed class DotnetWatchAnnotation(bool enableHotReload) : IResourceAnnotation
+ {
+     public bool EnableHotReload { get; } = enableHotReload;
+ }

Usage Examples

appBuilder.AddProject<Projects.WebProject>("webfrontend")
            .WithAnnotation(new DotnetWatchAnnotation(enableHotReload: true));

Alternative Designs

The .WithArgs() method could be overloaded, to allow to override the default options.
Currently the arguments just get appended at the end of the command.

Risks

The API change would not introduce any breaking changes

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Jul 11, 2024
@Juulsn
Copy link
Author

Juulsn commented Jul 11, 2024

See #4846

@Juulsn
Copy link
Author

Juulsn commented Aug 6, 2024

hey @mitchdenny any news on this?

@mitchdenny
Copy link
Member

No news. Thanks for submitting the API design proposal. One of the factors impacting this is that we are starting to look at adding the ability to stop and restart resources within the app model (where applicable). I can imagine that this will have impacts on things like hot reload.

So, this will likely be in a holding pattern until we figure that out. It might render this unnecessary and its best not to have two ways of doing things if we can avoid it.

@davidfowl
Copy link
Member

First class dotnet watch support is coming, track the issue dotnet/sdk#36971

@davidfowl davidfowl closed this as not planned Won't fix, can't repro, duplicate, stale Sep 8, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Projects
None yet
Development

No branches or pull requests

3 participants