Save thread working directory for fallback in Expander and Modifiers
Fixes #12851 #12800
Context
there are 2 places where it's impractical to pass TaskEnvironment but the code relies on CWD
- Expander
- Modifier on TaskItems -> FullPath
Changes Made
introduce AsyncLocal CWD variable tied to lifetime of a TaskEnvironment
Testing
updated existing tests to dispose the environment demo this fixes: AsyncLocalDemo.zip
Notes
this makes the Aspire starter project build
@rainersigwald @AR-May this was in the prototype branch and seems very painful to avoid the thread static, so I just took it and made the lifecycle better. Should I try more to figure out the expander and metadata another way? I think it's quite bad UX to ban taskitem.GetMetadata("FullPath") in enlightened tasks :( that seems like something that customers would expect to work.