Similar to that big list on Wikipedia of "if you modulo with a negative number as right operand, what happens?", someone should make a list of every programming language and make a similar by-language list of "what happens if you are enumerating over the built-in dictionary type, and you [add a key to the dictionary]/[delete the key of the currently enumerated key-value pair from the dictionary]?"
@mcc "Hello Computer!"
UPDATE: Okay so fortunately, the relevant question on StackOverflow got one last reply before all the humans stopped contributing to the site.
".NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are Remove and Clear."
That's so helpful! Now I only need to solve one of the hardest problems in computer science: Figuring out which version of the .NET standard library is installed on the particular computer you are using for development
@mcc if it's only about the .NET Standard Library, look at the top table of this Wikipedia article: https://en.wikipedia.org/wiki/.NET_Framework_version_history
It says which .NET **Framework** version is pre-installed with which OS version. You can then look through the MS Docs to see which Framework version equals to which Standard Version.
@alxhu Thanks.
However, we're running "net8.0", which isn't in either of these tables.
I *THINK* I'm going to conclude that with ".NET Core 8", Microsoft dropped the "Core" and named it only ".NET 8", and therefore "net8.0" > ".NET Core 3.0"
@mcc I see. By default, no .NET 5+ version is pre-installed on any OS.
I know there is a setting to include any necessary .NET files in the deployment so you don't need to figure out which is installed (because you will ship the framework with your product), but I forgot what the settings name was.
@alxhu Well what I would have said if I wasn't being a little vague above was "we have installed dotnet 10.0.403, and configured 'net8.0' in our csproj". And dotnet publish will worry about deployment for us.
@mcc It can't whisper sweet Nothings to you. That's VB.NET, not C#.
Wait, no. I know how to get an answer to my question. **Pulls up Claude at claude.com** **Speaking clearly into the computer mouse** "Claude. Please lie to me convincingly about the behavior of C# IReadOnlyDictionary<T,K>.Enumerator"