From dbea6d73b9ba1851552c91d18b4aaf29aaaac9b2 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 28 Mar 2023 08:51:33 -0400 Subject: [PATCH] [workload] Fix using empty RuntimeIdentifier in LibraryBuilder AutoImport.props (#83834) When `mobile-librarybuilder-experimental` is installed, the LibraryBuilder SDK AutoImport.props activates and it incorrectly tries to IndexOf RuntimeIdentifier even when it's an empty string. This can lead to annoying error messages popping up even when not using the workload. The fix is to add a condition only when RuntimeIdentifier has a value. --- .../Sdk/AutoImport.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/nuget/Microsoft.NET.Runtime.LibraryBuilder.Sdk/Sdk/AutoImport.props b/src/mono/nuget/Microsoft.NET.Runtime.LibraryBuilder.Sdk/Sdk/AutoImport.props index 7f2d0c1c49a..1aab677ff56 100644 --- a/src/mono/nuget/Microsoft.NET.Runtime.LibraryBuilder.Sdk/Sdk/AutoImport.props +++ b/src/mono/nuget/Microsoft.NET.Runtime.LibraryBuilder.Sdk/Sdk/AutoImport.props @@ -1,7 +1,7 @@ - $(RuntimeIdentifier.Substring(0, $(RuntimeIdentifier.IndexOf('-')))) + $(RuntimeIdentifier.Substring(0, $(RuntimeIdentifier.IndexOf('-')))) true true -- 2.34.1