Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Ambiguous call in MapReduce Sample #9998

Open
joslat opened this issue Dec 17, 2024 · 4 comments · May be fixed by #10013
Open

.Net: Ambiguous call in MapReduce Sample #9998

joslat opened this issue Dec 17, 2024 · 4 comments · May be fixed by #10013
Assignees
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code processes samples

Comments

@joslat
Copy link
Contributor

joslat commented Dec 17, 2024

Hi, I am having while building up the .NET Solution an error due to an ambiguous call,

I am getting: "Severity Code Description Project File Line Suppression State
Error CS0121 The call is ambiguous between the following methods or properties: 'string.Split(char[]?, StringSplitOptions)' and 'string.Split(string?, StringSplitOptions)' GettingStartedWithProcesses C:\git\joslat\semantic-kernel\dotnet\samples\GettingStartedWithProcesses\Step05\Step05_MapReduce.cs 119 Active"

Where: \semantic-kernel\dotnet\samples\GettingStartedWithProcesses\Step05\Step05_MapReduce.cs

Image

@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Dec 17, 2024
@github-actions github-actions bot changed the title .NET: Ambiguous call in MapReduce.cs .Net: Ambiguous call in MapReduce.cs Dec 17, 2024
@evchaki evchaki added bug Something isn't working processes labels Dec 17, 2024
@evchaki
Copy link
Contributor

evchaki commented Dec 17, 2024

@crickman can you take a look?

@sphenry sphenry removed the triage label Dec 17, 2024
@crickman crickman self-assigned this Dec 18, 2024
@crickman crickman moved this to Sprint: In Progress in Semantic Kernel Dec 18, 2024
@crickman
Copy link
Contributor

@joslat - I'm not able to reproduce this error and its not occuring in our build / release pipeline. I'm guessing there's some different between our build / development environments. In anycase, I can switch this to an array of strings to get around the ambitugity on your system.

@crickman crickman moved this from Sprint: In Progress to Sprint: In Review in Semantic Kernel Dec 18, 2024
@crickman crickman linked a pull request Dec 18, 2024 that will close this issue
3 tasks
@joslat
Copy link
Contributor Author

joslat commented Dec 18, 2024

that would do, I changed it to this locally for it to build, for if it helps :)

string[] words = chunk.Split(new char[] { ' ', '\n', '\r', '.', ',', '’' }, StringSplitOptions.RemoveEmptyEntries);

@crickman crickman changed the title .Net: Ambiguous call in MapReduce.cs .Net: Ambiguous call in MapReduce Sample Dec 18, 2024
@crickman
Copy link
Contributor

that would do, I changed it to this locally for it to build, for if it helps :)

string[] words = chunk.Split(new char[] { ' ', '\n', '\r', '.', ',', '’' }, StringSplitOptions.RemoveEmptyEntries);

FWIW: We get warnings/suggestions when using that syntax in our envronment. There's a strong preference for the collection initializer: [...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code processes samples
Projects
Status: Sprint: In Review
Development

Successfully merging a pull request may close this issue.

5 participants