Uh oh!
There was an error while loading. Please reload this page.
[tasks] [net472] Add ProjectReferences to JsonToItemsTaskFactory - #58825
Conversation
ghost
commented
Sep 8, 2021
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
lambdageek
commented
Sep 8, 2021
We will need to backport this to 6.0, I think. |
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`
lambdageek
commented
Sep 8, 2021
@ViktorHofer@steveisok@akoeplinger Should I make some I'm concerned a |
5bcba3d to
3b31901Compare0aae9f3 to
b919de0Comparelambdageek
commented
Sep 10, 2021
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1219721635 |
| <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" PrivateAssets="all" /> | ||
| <PackageReference Include="System.Text.Json" Version="5.0.0" PrivateAssets="all" /> |
There was a problem hiding this comment.
The version numbers should not be hardcoded here
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:
from
C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.MonoTargets.Sdk\6.0.0-rc.1.21451.13\Sdk\RuntimeComponentManifest.targetsUltimately this is because msbuild has a binding redirect here:
https://github.com/dotnet/msbuild/blob/1a1f20e4980fd1b02426b62220480f86e6ec5abf/src/MSBuild/app.config#L97
that points to an older version of System.Threading.Tasks.Extensions than what they end up building with, but that happens to coincide with the one that the JsonToItemsTaskFactory task bundles.
Related PR dotnet/msbuild#6830