diff --git a/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/RuntimeComponentManifest.targets b/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/RuntimeComponentManifest.targets index 411aeec01e563..fcf1ff70d9a8f 100644 --- a/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/RuntimeComponentManifest.targets +++ b/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/RuntimeComponentManifest.targets @@ -1,10 +1,16 @@ - + + - <_MonoRuntimeComponentManifestJsonFilePath Condition="'$(_MonoRuntimeComponentManifestJsonFilePath)' == ''">%(ResolvedRuntimePack.PackageDirectory)\runtimes\$(RuntimeIdentifier)\build\RuntimeComponentManifest.json + <_MonoRuntimeComponentManifestJsonFilePath + Condition="'$(_MonoRuntimeComponentManifestJsonFilePath)' == '' and '%(ResolvedFrameworkReference.Identity)' == 'Microsoft.NETCore.App'">$([MSBuild]::NormalizePath('%(RuntimePackPath)', 'runtimes', '$(RuntimeIdentifier)', 'build', 'RuntimeComponentManifest.json')) + + + diff --git a/src/tasks/JsonToItemsTaskFactory/JsonToItemsTaskFactory.cs b/src/tasks/JsonToItemsTaskFactory/JsonToItemsTaskFactory.cs index 2f7d1dc7ebfbe..b0d710e77f714 100644 --- a/src/tasks/JsonToItemsTaskFactory/JsonToItemsTaskFactory.cs +++ b/src/tasks/JsonToItemsTaskFactory/JsonToItemsTaskFactory.cs @@ -173,6 +173,12 @@ public bool Execute() Log.LogError($"no {nameof(JsonFilePath)} specified"); return false; } + if (!File.Exists(jsonFilePath)) + { + Log.LogError($"Could not find {nameof(JsonFilePath)}={jsonFilePath}"); + return false; + } + if (!TryGetJson(jsonFilePath, out var json)) return false; diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Blazor.Directory.Build.targets b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Blazor.Directory.Build.targets index b0384d714e345..f77fc96c48d05 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Blazor.Directory.Build.targets +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Blazor.Directory.Build.targets @@ -36,13 +36,12 @@ PackageDirectory="$(NetCoreTargetingPackRoot)\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\$(RuntimePackInWorkloadVersion)" RuntimeIdentifier="browser-wasm" /> - + diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Workloads.Directory.Build.targets b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Workloads.Directory.Build.targets index 62e463bb19958..105c0a74c0875 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Workloads.Directory.Build.targets +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Workloads.Directory.Build.targets @@ -53,13 +53,12 @@ PackageDirectory="$(NetCoreTargetingPackRoot)\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\$(RuntimePackInWorkloadVersion)" RuntimeIdentifier="browser-wasm" /> - +