runtime: Intermittent build failures caused by missing PlatformManifest.txt

Over the last few weeks I’ve intermittently had my checkouts enter a bad state where builds always fail with these errors:

/home/kate/Projects/dotnet-runtime-wasm/.dotnet/sdk/6.0.100-rc.2.21505.57/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from '/home/kate/Projects/dotnet-runtime-wasm/artifacts/bin/microsoft.netcore.app.ref/data/PlatformManifest.txt' because it did not exist. [/home/kate/Projects/dotnet-runtime-wasm/src/libraries/System.Diagnostics.PerformanceCounter/ref/System.Diagnostics.PerformanceCounter.csproj]
/home/kate/Projects/dotnet-runtime-wasm/.dotnet/sdk/6.0.100-rc.2.21505.57/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from '/home/kate/Projects/dotnet-runtime-wasm/artifacts/bin/microsoft.netcore.app.ref/data/PlatformManifest.txt' because it did not exist. [/home/kate/Projects/dotnet-runtime-wasm/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.csproj]
/home/kate/Projects/dotnet-runtime-wasm/.dotnet/sdk/6.0.100-rc.2.21505.57/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from '/home/kate/Projects/dotnet-runtime-wasm/artifacts/bin/microsoft.netcore.app.ref/data/PlatformManifest.txt' because it did not exist. [/home/kate/Projects/dotnet-runtime-wasm/src/libraries/System.Threading.AccessControl/ref/System.Threading.AccessControl.csproj]
/home/kate/Projects/dotnet-runtime-wasm/.dotnet/sdk/6.0.100-rc.2.21505.57/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from '/home/kate/Projects/dotnet-runtime-wasm/artifacts/bin/microsoft.netcore.app.ref/data/PlatformManifest.txt' because it did not exist. [/home/kate/Projects/dotnet-runtime-wasm/src/libraries/System.Windows.Extensions/ref/System.Windows.Extensions.csproj]
/home/kate/Projects/dotnet-runtime-wasm/.dotnet/sdk/6.0.100-rc.2.21505.57/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from '/home/kate/Projects/dotnet-runtime-wasm/artifacts/bin/microsoft.netcore.app.ref/data/PlatformManifest.txt' because it did not exist. [/home/kate/Projects/dotnet-runtime-wasm/src/libraries/Microsoft.Extensions.FileProviders.Physical/ref/Microsoft.Extensions.FileProviders.Physical.csproj]

I’m using the repo-local .dotnet folder to build and nuking that folder doesn’t fix it, neither does nuking the .nuget in my homedir. git clean -xffd also doesn’t fix it. I’m not actually sure how I fixed it last time but now my checkout seems to be busted for good.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 2
  • Comments: 23 (23 by maintainers)

Most upvoted comments

Let’s have that discussion in https://github.com/dotnet/sdk/issues/22834.

@kg the cache in question is in an MSBuild worker process so pkill -9 dotnet (or even the subset of them that are running a command line with MSBuild.dll in it) should be all you need (and faster than deleting/regenerating .dotnet).

Another possibility for a workaround that could be checked in is a Directory.Build.rsp with -nodeReuse:false in it. That would slow down builds (every build has to pay process-creation overhead for MSBuild workers and starts with clean memory caches) but should eliminate this caching problem.

I can verify this build failure.

C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: PlatformManifest konnte nicht von "E:\external\dotnet\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt" geladen werden, weil es nicht vorhanden ist. [E:\external\dotnet\runtime\src\libraries\Microsoft.Extensions.DependencyInjection.Abstractions\ref\Microsoft.Extensions.DependencyInjection.Abstractions.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: PlatformManifest konnte nicht von "E:\external\dotnet\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt" geladen werden, weil es nicht vorhanden ist. [E:\external\dotnet\runtime\src\libraries\Microsoft.Extensions.Logging.Abstractions\ref\Microsoft.Extensions.Logging.Abstractions.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: PlatformManifest konnte nicht von "E:\external\dotnet\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt" geladen werden, weil es nicht vorhanden ist. [E:\external\dotnet\runtime\src\libraries\Microsoft.Extensions.FileProviders.Composite\ref\Microsoft.Extensions.FileProviders.Composite.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: PlatformManifest konnte nicht von "E:\external\dotnet\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt" geladen werden, weil es nicht vorhanden ist. [E:\external\dotnet\runtime\src\libraries\System.Drawing.Common\ref\System.Drawing.Common.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: PlatformManifest konnte nicht von "E:\external\dotnet\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt" geladen werden, weil es nicht vorhanden ist. [E:\external\dotnet\runtime\src\libraries\System.DirectoryServices.AccountManagement\ref\System.DirectoryServices.AccountManagement.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: PlatformManifest konnte nicht von "E:\external\dotnet\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt" geladen werden, weil es nicht vorhanden ist. [E:\external\dotnet\runtime\src\libraries\System.Formats.Cbor\ref\System.Formats.Cbor.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: PlatformManifest konnte nicht von "E:\external\dotnet\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt" geladen werden, weil es nicht vorhanden ist. [E:\external\dotnet\runtime\src\libraries\System.IO.Packaging\ref\System.IO.Packaging.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: PlatformManifest konnte nicht von "E:\external\dotnet\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt" geladen werden, weil es nicht vorhanden ist. [E:\external\dotnet\runtime\src\libraries\System.IO.Pipelines\ref\System.IO.Pipelines.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: PlatformManifest konnte nicht von "E:\external\dotnet\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt" geladen werden, weil es nicht vorhanden ist. [E:\external\dotnet\runtime\src\libraries\System.Resources.Extensions\ref\System.Resources.Extensions.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: PlatformManifest konnte nicht von "E:\external\dotnet\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt" geladen werden, weil es nicht vorhanden ist. [E:\external\dotnet\runtime\src\libraries\System.Numerics.Tensors\ref\System.Numerics.Tensors.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: PlatformManifest konnte nicht von "E:\external\dotnet\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt" geladen werden, weil es nicht vorhanden ist. [E:\external\dotnet\runtime\src\libraries\System.Security.Cryptography.ProtectedData\ref\System.Security.Cryptography.ProtectedData.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: PlatformManifest konnte nicht von "E:\external\dotnet\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt" geladen werden, weil es nicht vorhanden ist. [E:\external\dotnet\runtime\src\libraries\System.ServiceModel.Syndication\ref\System.ServiceModel.Syndication.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: PlatformManifest konnte nicht von "E:\external\dotnet\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt" geladen werden, weil es nicht vorhanden ist. [E:\external\dotnet\runtime\src\libraries\Microsoft.Extensions.Configuration.Ini\ref\Microsoft.Extensions.Configuration.Ini.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: PlatformManifest konnte nicht von "E:\external\dotnet\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt" geladen werden, weil es nicht vorhanden ist. [E:\external\dotnet\runtime\src\libraries\Microsoft.Extensions.Configuration.Json\ref\Microsoft.Extensions.Configuration.Json.csproj]

I can verify Adams workaround using taskkill /IM "dotnet.exe" /F.

dotnet build-server shutdown might also work (but I haven’t tested this - credits @Wraith2)

Yeah, we can add an input to the task and pass a property through to it. It would require an SDK update. @marcpopMSFT would you have any objection to adding such a feature to an SDK task when the only expected consumer is the runtime build? I personally don’t . . .

I am now getting the same error on Windows, after git clean -xfd:

C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\Microsoft.Extensions.DependencyInjection.Abstractions\ref\Microsoft.Extensions.DependencyInjection.Abstractions.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\System.ComponentModel.Composition\ref\System.ComponentModel.Composition.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\Microsoft.Win32.Registry.AccessControl\ref\Microsoft.Win32.Registry.AccessControl.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\System.Runtime.Caching\ref\System.Runtime.Caching.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\System.Formats.Cbor\ref\System.Formats.Cbor.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\System.Security.Cryptography.Xml\ref\System.Security.Cryptography.Xml.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\System.Security.Cryptography.Pkcs\ref\System.Security.Cryptography.Pkcs.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\System.Speech\ref\System.Speech.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\System.IO.Ports\ref\System.IO.Ports.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\System.Data.Odbc\ref\System.Data.Odbc.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\Microsoft.Win32.SystemEvents\ref\Microsoft.Win32.SystemEvents.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\System.Diagnostics.PerformanceCounter\ref\System.Diagnostics.PerformanceCounter.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\System.Numerics.Tensors\ref\System.Numerics.Tensors.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\System.DirectoryServices.Protocols\ref\System.DirectoryServices.Protocols.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\System.ServiceModel.Syndication\ref\System.ServiceModel.Syndication.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\System.Security.Permissions\ref\System.Security.Permissions.csproj]
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\Microsoft.Extensions.Configuration.Abstractions\ref\Microsoft.Extensions.Configuration.Abstractions.csproj]

Edit 1: after:

$env:DOTNETSDK_ALLOW_TARGETING_PACK_CACHING=0

I am getting only one error:

C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(40,5): error NETSDK1042: Could not load PlatformManifest from 'D:\projects\runtime\artifacts\bin\microsoft.netcore.app.ref\data\PlatformManifest.txt' because it did not exist. [D:\projects\runtime\src\libraries\System.Net.Quic\ref\System.Net.Quic.cspro

Edit 2: after taskkill /IM "dotnet.exe" /F I was able to build everything without a single error