Skip to content

fix ambiguous call to string.Split#2285

Closed
agollivermsft wants to merge 2 commits intogit-ecosystem:mainfrom
agollivermsft:ambiguous-call
Closed

fix ambiguous call to string.Split#2285
agollivermsft wants to merge 2 commits intogit-ecosystem:mainfrom
agollivermsft:ambiguous-call

Conversation

@agollivermsft
Copy link
Contributor

@agollivermsft agollivermsft commented Mar 10, 2026

DEPENDS ON: #2286 (update from net472 to net8.0 on windows)

On an Ubuntu 24.04 image I get from work ./src/linux/Packaging.Linux/install-from-source.sh fails with

dotnet --version
8.0.124
MSBuild version 17.8.49+7806cbf7b for .NET
  Determining projects to restore...
  Restored /tmp/tmp.LyZev1gOKL/src/linux/Packaging.Linux/Packaging.Linux.csproj (in 361 ms).
  Restored /tmp/tmp.LyZev1gOKL/src/shared/Microsoft.AzureRepos/Microsoft.AzureRepos.csproj (in 5.46 sec).
  Restored /tmp/tmp.LyZev1gOKL/src/shared/Core/Core.csproj (in 5.46 sec).
  Restored /tmp/tmp.LyZev1gOKL/src/shared/Atlassian.Bitbucket/Atlassian.Bitbucket.csproj (in 5.46 sec).
  Restored /tmp/tmp.LyZev1gOKL/src/shared/GitHub/GitHub.csproj (in 5.46 sec).
  Restored /tmp/tmp.LyZev1gOKL/src/shared/GitLab/GitLab.csproj (in 5.46 sec).
  Restored /tmp/tmp.LyZev1gOKL/src/shared/Git-Credential-Manager/Git-Credential-Manager.csproj (in 7.67 sec).
/tmp/tmp.LyZev1gOKL/src/shared/Core/Interop/Linux/LinuxConfigParser.cs(34,45): error CS0121: The call is ambiguous between the following methods or properties: 'string.Split(char[]?, StringSplitOptions)' and 'string.Split(string?, StringSplitOptions)' [/tmp/tmp.LyZev1gOKL/src/shared/Core/Core.csproj::TargetFramework=net8.0]

Build FAILED.

/tmp/tmp.LyZev1gOKL/src/shared/Core/Interop/Linux/LinuxConfigParser.cs(34,45): error CS0121: The call is ambiguous between the following methods or properties: 'string.Split(char[]?, StringSplitOptions)' and 'string.Split(string?, StringSplitOptions)' [/tmp/tmp.LyZev1gOKL/src/shared/Core/Core.csproj::TargetFramework=net8.0]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:17.29

I don't know much C#, but this change got it to compile & it seems to work locally (I was able to use g-c-m installed from this branch to push this PR, at least)

@agollivermsft agollivermsft requested a review from a team as a code owner March 10, 2026 18:26
@agollivermsft
Copy link
Contributor Author

hmm... so now it works on my ubuntu machine (and linux CI generally), but not on windows. Curious.

@mjcheetham
Copy link
Contributor

This has bene addressed in #2287

@mjcheetham mjcheetham closed this Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants