© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•10mo ago•
4 replies
Yawnder

✅ Issue with Collection Expression in the ubuntu-latest VM of Azure.

I have this build that fails in my azure pipeline with
The call is ambiguous between the following methods or properties: 'string.Split(char[]?, StringSplitOptions)' and 'string.Split(string?, StringSplitOptions)
The call is ambiguous between the following methods or properties: 'string.Split(char[]?, StringSplitOptions)' and 'string.Split(string?, StringSplitOptions)
, but it doesn't fail locally.
From what I understand, it's because of the difference in the SDK used locally, and the one used in the VM used by the build agent,
ubuntu-latest
ubuntu-latest
. This SO answer highlights the reason, and how to address it: https://stackoverflow.com/a/78959408

How would you go about actually addressing it, considering that my pipeline's yml definition requests
ubuntu-latest
ubuntu-latest
, so unless I actually downgrade to something older than a year or so, it will still happen right?

I know I can make the collection expression explicit (
["...", "..."]
["...", "..."]
to
new string[] { "...", "..." }
new string[] { "...", "..." }
) but is there another way of addressing it.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

collection expression on Span<T>
C#CC# / help
3y ago
❔ Azure VM network very slow
C#CC# / help
4y ago
Integration Test issue on ubuntu-latest (.NET 8)
C#CC# / help
17mo ago
Replacing AzureKeyVault with Azure.Extensions.AspNetCore.Configuration.Secrets
C#CC# / help
2y ago