Reputation: 4190
I am using Visual Studio 2013. When I use in code objects like Action<T> or Func<T, TSource> in unity i am getting error:
TypeLoadException: Could not load type 'System.Action' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
TypeLoadException: Could not load type 'System.Func`1' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
I tried to switch project to Framework 4.0, but that didn't helped. Any ideas?
Upvotes: 0
Views: 416
Reputation: 183
AFAIK Unity only supports the Framework 2.0 with some of the 3.5 features.
In Edit->Project Settings->Player->Other Settings be sure to choose the full .NET 2.0 framework and not the subset.
UPDATE : In VS, you have to compile every DLL in 3.5.
Normally your code should work correctly.
Hope that helps...
Upvotes: 3