aspire: Don't hardcode project, and dcp paths in the assemblies
Currently we add various resolved dcp paths, and some projects in AppHost.dll. This makes the build output tied to the same machine or at least one with the same layout.
Instead, we should consider adding all this information to a new json (or a custom section in runtimeconfig.json) file which gets deployed with the build output. The project paths can be keyed by their names. launchsettings needed from the various projects can also be directly referenced or deployed with the AppHost output.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 15 (15 by maintainers)
DCP is in the workload, which is why we added the attributes. We need to know the path to the assemblies at runtime, but we only know the actual path at build time via the workload targets, hence we write attributes at build time to store the data.
What you’re seeing with the nuget package paths is only for the Aspire repo; we don’t want to require the workload when building or running the tests or playground apps, so we do some logic to pull down a DCP nuget for the appropriate local architecture and version and point to that instead of the workload.
Now that I think about it, we should be able to pass
—dcp-cli-pathwhen running the AppHost to load DCP from a known path at runtime, as I did set up some config processing for these properties.