prom3theu5 / aspirational-manifests

Handle deployments of .NET Aspire AppHost Projects
MIT License
702 stars 36 forks source link

Why default to self contained publish? #221

Closed davidfowl closed 5 months ago

davidfowl commented 5 months ago

I was trying out aspirate on the aspire playground samples and it fails:

Executing: dotnet publish "C:\dev\git\aspire\playground\mongo\Mongo.AppHost\../Mongo.ApiService/Mongo.ApiService.csproj"
-p:PublishProfile="DefaultContainer" -p:PublishSingleFile="true" -p:PublishTrimmed="false" --self-contained "true"
--verbosity "quiet" --nologo -r "linux-x64" -p:ContainerRepository="api" -p:ContainerImageTag="latest"
C:\Program Files\dotnet\sdk\8.0.206\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5):
error NETSDK1047: Assets file 'C:\dev\git\aspire\artifacts\obj\ConfigurationSchemaGenerator\project.assets.json' doesn't
have a target for 'net8.0/win-x64'. Ensure that restore has run and that you have included 'net8.0' in the
TargetFrameworks for your project. You may also need to include 'win-x64' in your project's RuntimeIdentifiers.
[C:\dev\git\aspire\src\Tools\ConfigurationSchemaGenerator\ConfigurationSchemaGenerator.csproj]

I noticed a couple of extra parameters and I wondered where they were coming from. The project should be in control of those arguments if specified and aspirate shouldn't override them.

prom3theu5 commented 5 months ago

Good call

https://github.com/prom3theu5/aspirational-manifests/blob/b92a3ea98c0c373b1a5926d2a1b2a467297213a0/src/Aspirate.Services/Implementations/ContainerCompositionService.cs#L183

We can handle the same as trimmed and single-file, or just remove passing them entirely as defaults, and have it the responsibility of the project file?

davidfowl commented 5 months ago

The latter. Let MSBuild decide

prom3theu5 commented 5 months ago

Done - Removed management of msbuild properties outside overriding container registry etc in v8.0.5