C# Generic List constructor gives me a MethodAccessException
Posted
by evilfred
on Stack Overflow
See other posts from Stack Overflow
or by evilfred
Published on 2010-06-09T20:46:42Z
Indexed on
2010/06/09
20:52 UTC
Read the original article
Hit count: 206
Hi,
I make a list in my code like so:
List<IConnection> connections = new List<IConnection>();
where IConnection is my own interface. This is in a .NET 2.0 executable. If I run the code on my machine (with lots of .Net versions installed) it works fine. If I run it on my test machine (which only has .NET 3.5 SP1 installed) then I get a MethodAccessException in the System.Collections.Generic.List constructor. Any ideas what could be going wrong?
© Stack Overflow or respective owner