Skip to content

Commit b5ad8cd

Browse files
committed
Fix unsupported API usage in .NET Framework
1 parent 5ba4f30 commit b5ad8cd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/PowerShellEditorServices/Language/LanguageService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,14 @@ public async Task<FindReferencesResult> FindReferencesOfSymbol(
310310

311311
// We want to look for references first in referenced files, hence we use ordered dictionary
312312
// TODO: File system case-sensitivity is based on filesystem not OS, but OS is a much cheaper heuristic
313+
#if CoreCLR
314+
// The RuntimeInformation.IsOSPlatform is not supported in .NET Framework
313315
var fileMap = RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
314316
? new OrderedDictionary()
315317
: new OrderedDictionary(StringComparer.OrdinalIgnoreCase);
318+
#else
319+
var fileMap = new OrderedDictionary(StringComparer.OrdinalIgnoreCase);
320+
#endif
316321
foreach (ScriptFile file in referencedFiles)
317322
{
318323
fileMap.Add(file.FilePath, file);

0 commit comments

Comments
 (0)