aspire icon indicating copy to clipboard operation
aspire copied to clipboard

Add MSBuild Tasks assembly to Aspire.Hosting

Open eerhardt opened this issue 1 year ago • 1 comments

https://github.com/dotnet/aspire/pull/1726 added an MSBuild Task because it needed to do some special XML processing.

Since there wasn't already a Tasks assembly, we used a RoslynCodeTaskFactory in order to get unblocked.

However, there is a perf penalty for using RoslynCodeTaskFactory. The task needs to be compiled the first time. On my machine, the first time this task is run takes about 700ms, where when the target runs subsequently it takes more like 70ms.

We should create a Tasks assembly and put this Task in it, so we don't need to compile it more than once.

eerhardt avatar Jan 24 '24 18:01 eerhardt

Pinging this - the Target that this Task is created in is run on every build, and in builds that are fairly incremental it sticks out like a sore thumb as an outlier.

Folks that work primarily in DevKit are hit especially hard by this, because DevKit doesn't have FUTDC or similar mechanisms - the pure MSBuild incremental build is all they have. Because projects like the Aspire AppHost, Test Projects, and so on are at the 'top' of the dependency graph, they're the long pole in the tent - changes that directly reduce the time it takes to build these kinds of projects have outsized impact on the wall-clock time of the build because they're happening more or less single-threaded.

baronfel avatar Oct 13 '25 22:10 baronfel

Pinging this again - this is one of the hot items for the Picasso team. They are on macOS + VScode, so CLI incremental build is a BIG DEAL for them, and this target makes the AppHost build lengthen the overall incremental build time by over a second for them.

baronfel avatar Nov 17 '25 17:11 baronfel

Moving to High

DamianEdwards avatar Nov 17 '25 21:11 DamianEdwards