-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[release/6.0] [tasks] [net472] Add ProjectReferences to JsonToItemsTaskFactory #58917
Conversation
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`
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. |
Tagging subscribers to this area: @directhex Issue DetailsBackport of #58825 to release/6.0 /cc @lambdageek Customer ImpactBuilding MAUI or WebAssembly projects from Visual Studio or using
TestingManual testing RiskLow. The change is just bumping our task to bundle the same (newer) versions of System.Text.Json and System.Threading.Tasks.Extensions that already ship with MSBuild instead of older ones that require a binding redirect. As a workaround
|
Backport of #58825 to release/6.0
/cc @lambdageek
Customer Impact
Building MAUI or WebAssembly projects from Visual Studio or using
msbuild
from the commandline may fail with aMissingMethodException
.Testing
Manual testing
Risk
Low. The change is just bumping our task to bundle the same (newer) versions of System.Text.Json and System.Threading.Tasks.Extensions that already ship with MSBuild instead of older ones that require a binding redirect.
As a workaround
dotnet build
works. Alternately the binding redirect for the MSBuild executable bundled with Visual Studio may be updated as detailed in dotnet/msbuild#6830