I have a .net 3.5 project in vs2008 and I’m trying to use this overload of string.Join() (the one that takes a string and IEnumerable<T>) and the compiler does not seem to know about this overload.
This is the code that I tried
var result = string.Join(" ", Foo());
where Foo() is
IEnumerable<string> Foo()
{
foreach(string s in new []{"1", "2", "3"} )
{
yield return s;
}
}
I get
> Error 2 Argument '2': cannot convert from
> 'System.Collections.Generic.IEnumerable<string>' to 'string[]'
Of course, if I use Foo().ToArray() it works but I’m wondering why the overload that takes IEnumerable<T> won’t work.
MSDN in classic view says it’s compatible with vs2008/.net 3.5

(I couldn’t find the message “This page is specific to….” in non-classic views so I thought I’d put up a screen-cap.)
The version information at the bottom says something different:
Note that you can find that version information at the bottom of the article, regardless of the selected view (it might just look a little different).
The note in the upper-right you have found is referring to the selected resource version you can find in the URL, such as in:
(highlighted in bold). Usually this selects the framework version as well (since those are released in tandem with VS), but apparently there seems to be a mistake in the classification here.
I’d just report it as a mistake.