tags:

views:

58

answers:

1

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?

+1  A: 

Hi there.

Just to remove some possibilities - re-build your code by replacing:

List<IConnection> connections = new List<IConnection>();

with

List<int> connections = new List<int>();

In other words, it might be helpful to know if the list can be created with a type other then IConnection.

I'm not sure where to take it after that, but at least give this a go, to see if you can get your code to run at all.

Cheers. Jas.

Jason Evans
oh, duh, one of the DLLs was out of date, thanks for your isolation suggestion, i feel totally dumb :)
evilfred