[release/6.0] [wasm] Require workloads if using `@(NativeFileReference)` (#58290)
* [wasm] Require workloads, if a project is using native references
Currently, if the `wasm-tools` workload is not installed, and a project
uses AOT, then the build fails with an error saying that the workload
is needed.
But if the project is using native references, but not AOT, then the
build does not fail. Instead, the `@(NativeFileReference)` just gets
ignored. Even though the wasm workload is needed to relink dotnet.wasm
with the native libraries.
Implementation:
- `$(RunAOTCompilation)` is a property, so it can be checked, and
wasm workload imports can be enabled.
- But `@(NativeFileReference)` is an item, and that gets evaluated in
the second phase, so we can't use that to affect the imports.
- Instead, we emit a warning from a target run before Build, if the
project has any native references, but the workload isn't enabled.
- Users can explicitly enable the workload by setting
`$(WasmBuildNative)==true`.
* Bump sdk for workload testing to 6.0.100-rc.2.21425.12
* Fix path to workload.stamp file
Co-authored-by: Ankit Jain <radical@gmail.com>