-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Open
Labels
area-System.Text.JsonuntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Description
Description
I get this error when building my project recently:
C:\Program Files\dotnet\sdk\10.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(308,5): error MSB4018: The "GenerateDepsFile" task failed unexpectedly.
C:\Program Files\dotnet\sdk\10.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(308,5): error MSB4018: System.TypeLoadException: Method 'DisposeAsync' in type 'System.Text.Json.Utf8JsonWriter' from assembly 'System.Text.Json, Version=10.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' does not have an implementation.
C:\Program Files\dotnet\sdk\10.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(308,5): error MSB4018: at Microsoft.Extensions.DependencyModel.DependencyContextWriter.Write(DependencyContext context, Stream stream)
C:\Program Files\dotnet\sdk\10.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(308,5): error MSB4018: at Microsoft.NET.Build.Tasks.GenerateDepsFile.WriteDepsFile(String depsFilePath)
C:\Program Files\dotnet\sdk\10.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(308,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute()
C:\Program Files\dotnet\sdk\10.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(308,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
C:\Program Files\dotnet\sdk\10.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(308,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()Reproduction Steps
The error does not appear with all projects I'm working on, but the project it happens with, uses Blazor Webassembly.
The error seems not to appear when running a full rebuild (clean+build).
The error seems not to appear after deleting all obj/bin folders from the day before.
Expected behavior
There should be no error during build.
Actual behavior
Build fails with error.
Regression?
No response
Known Workarounds
- Run a full rebuild (clean+build).
- Delete all obj/bin folders from the day before.
Configuration
No response
Other information
No response
Metadata
Metadata
Assignees
Labels
area-System.Text.JsonuntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner