[release/6.0] [tasks] [net472] Add ProjectReferences to JsonToItemsTaskFactory (...
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Mon, 13 Sep 2021 16:43:51 +0000 (09:43 -0700)
committerGitHub <noreply@github.com>
Mon, 13 Sep 2021 16:43:51 +0000 (09:43 -0700)
commit9a90d3b1303a19224b5da0a608cea5a61034ea8a
tree3e19925172dd123871427725249b055a25207997
parent3e3fd870b65cc2de725fb402ceedee2e4dc5523c
[release/6.0] [tasks] [net472] Add ProjectReferences to JsonToItemsTaskFactory (#58917)

* [tasks] [net472] Add ProjectReferences to JsonToItemsTaskFactory

Reference the same versions of System.Threding.Tasks.Extensions and
System.Text.Json that MSBuild in Visual Studio 2022 uses.

Fixes build errors on maui-ios (and possibly blazorwasm) targets on Windows
like:

```
System.MissingMethodException: Method not found: 'System.Threading.Tasks.ValueTask`1<!!0> System.Text.Json.JsonSerializer.DeserializeAsync(System.IO.Stream, System.Text.Json.JsonSerializerOptions, System.Threading.CancellationToken)'.
   at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.<GetJsonAsync>d__24.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.GetJsonAsync(String jsonFilePath, FileStream file)
   at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.TryGetJson(String jsonFilePath, JsonModelRoot& json)
   at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at
   Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
```

from `C:\Program
Files\dotnet\packs\Microsoft.NET.Runtime.MonoTargets.Sdk\6.0.0-rc.1.21451.13\Sdk\RuntimeComponentManifest.targets`

* assembly version is 4.2.0.1, but nuget version is 4.5.4, apparently

Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
src/tasks/JsonToItemsTaskFactory/JsonToItemsTaskFactory.csproj