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

Added AddProject overload that takes a project path #1071

Merged
merged 4 commits into from
Nov 29, 2023

Conversation

davidfowl
Copy link
Member

  • To enable out of solution projects to be added trivially, added an overload of AddProject that takes the project path.
  • Exposed ProjectDirectory on the builder to enable resources to resolve physical paths earlier. This cleans up lots of code from having to understand if paths of fully qualified or not.

Fixes #1065

- To enable out of solution projects to be added trivially, added an overload of AddProject that takes the project path.
- Exposed ProjectDirectory on the builder to enable resources to resolve physical paths earlier. This cleans up lots of code from having to understand if paths of fully qualified or not.

Fixes #1065
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Nov 28, 2023
/// <summary>
/// Directory of the project where the app host is located. Defaults to the content root if there's no project.
/// </summary>
public string ProjectDirectory { get; }
Copy link
Member Author

@davidfowl davidfowl Nov 28, 2023

Choose a reason for hiding this comment

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

@mitchdenny this cleans up A LOT and it's what your docker file PR should be using.

Copy link
Member

Choose a reason for hiding this comment

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

Do you think we should call it something like AppHostDirectory instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep

@davidfowl
Copy link
Member Author

/azp run

Copy link

No pipelines are associated with this pull request.


internal class ServiceMetadata(string projectPath) : IServiceMetadata
{
public string AssemblyName => throw new NotImplementedException();
Copy link
Member

Choose a reason for hiding this comment

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

Wondering whether we can ditch assembly name and assembly path now given that we don't auto name components.

Copy link
Member

Choose a reason for hiding this comment

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

Looks like we don't reference them anymore. I think we initially had then because we were doing a dotnet run against the assembly itself vs. launching the project. That changed but this never got removed and the assembly name was only ever used as an input for autonaming projects which is now gone.

Copy link
Member

Choose a reason for hiding this comment

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

I know I used them somewhere by newing up an instances of the generated classes to get the paths but I can't remember where. No doubt we'll remove it and then I'll find it/remember again 😄

@davidfowl davidfowl merged commit 98cec75 into main Nov 29, 2023
3 checks passed
@davidfowl davidfowl deleted the davidfowl/add-project branch November 29, 2023 01:37
@davidfowl davidfowl mentioned this pull request Nov 29, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 28, 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

Successfully merging this pull request may close these issues.

Add overload of AddProject that doesn't take an IServiceMetadata
3 participants