From 436d2aae46d9ac1f6bda0b99d7dbb7c723c6cdc5 Mon Sep 17 00:00:00 2001 From: Yehezkel Bernat Date: Mon, 4 Nov 2024 01:35:49 +0200 Subject: [PATCH] Workaround for issue 40015: nuget restore uses 'resource' instead of 'resources' Fixes #40015 --- src/Tasks/Microsoft.NET.Build.Tasks/ResolvedFile.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ResolvedFile.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ResolvedFile.cs index f0a227e2e940..e4a3031836c8 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ResolvedFile.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ResolvedFile.cs @@ -70,6 +70,11 @@ public ResolvedFile(ITaskItem item, bool isRuntimeTarget) { Asset = AssetType.Resources; } + // Workaround for issue 40015: nuget restore uses 'resource' instead of 'resources' + else if (assetType.Equals("resource", StringComparison.OrdinalIgnoreCase)) + { + Asset = AssetType.Resources; + } else { throw new InvalidOperationException($"Unrecognized AssetType '{assetType}' for {SourcePath}");