I got this error in one project when I switched from Visual Studio 2012 to Visual Studio Community 2013.
In my case it was giant file (25k lines, not written by me) with had List<string[]>
initialized by collection initializer.
Something like this:
public class Class
{
public List<string[]> BigList
{
get
{
return new List<string[]>()
{
new string[]{"foo","bar"},
new string[]{"foo","bar"},
new string[]{"foo","bar"},
new string[]{"foo","bar"},
.
.
.
.
.
new string[]{"foo","bar"},
new string[]{"foo","bar"},
new string[]{"foo","bar"},
new string[]{"foo","bar"}
}
}
}
}
I changed it to string[][]
and the project started to compile
public class Class
{
public string[][] BigList
{
get
{
return new string[][]
{
new string[]{"foo","bar"},
new string[]{"foo","bar"},
new string[]{"foo","bar"},
new string[]{"foo","bar"},
.
.
.
.
.
new string[]{"foo","bar"},
new string[]{"foo","bar"},
new string[]{"foo","bar"},
new string[]{"foo","bar"}
}
}
}
}