[workload] Fix using empty RuntimeIdentifier in LibraryBuilder AutoImport.props ...
authorSteve Pfister <steveisok@users.noreply.github.com>
Tue, 28 Mar 2023 12:51:33 +0000 (08:51 -0400)
committerGitHub <noreply@github.com>
Tue, 28 Mar 2023 12:51:33 +0000 (08:51 -0400)
commitdbea6d73b9ba1851552c91d18b4aaf29aaaac9b2
tree72975fadf1a9fafb074521c67d0273961dc57b6d
parent3231e4fbfbef268b1647bf6f695e6b42cfb2117d
[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.
src/mono/nuget/Microsoft.NET.Runtime.LibraryBuilder.Sdk/Sdk/AutoImport.props