I\'m getting the following error on one of my referenced assemblies:
Could not load type \'System.Func`2\' from assembly \'MyAssembly, ...
I\'ll
I received this error after refactoring. I had two projects compiling to DLLs with the same name.
Check the "Assembly name" in the project's properties' "Application" section.
I encountered this exception when I refactored to move some classes to their own library, and referenced a different version of the library it's trying to load in the new library (acquired with NuGet) than I had been using in the original project.
The thing that fixed it was to open the NuGet Manager in the old project, and update the appropriate package to be the same version I was using in my new library.
I'm not sure about your specific scenario, but the Assembly Binding Log Viewer (fuslogvw) is usually very helpful in debugging type load issues. More details at http://msdn.microsoft.com/en-us/library/e74a18c4.aspx
I got this error when I moved a class from one project to another in a cleanup effort. After looking at all other possible reasons, reloaded each of the projects in my solution and everything worked.
You may also get this if you change the assembly you're trying to load but still have an old version in the GAC. It tries to load the GAC'ed version not what you reference in your VS project.
This problem may occur if you have different versions of NuGet packages installed across different projects. To identify these cases,