I created a project which contained interfaces that use covariant generic (<out T>) types. The project compiled without error. When I then used the VS2010 Unit Test wizard to create unit tests for the project, the first build of the unit test project had errors on the private accessors that Visual Studio had generated:
Could not load type 'MultiTree.ITreeNode_Impl`1' from assembly 'MultiTree_Accessor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' because it declares a covariant or contravariant type parameter and is not an interface or delegate. MultiTree Unit Tests
I tried modifying the unit tests to use explicit types in the tests, but kept getting the error with every build of anything in the original project or of the unit test project. The only way I discovered to eliminate the error was to rename (or remove) the .accessor file, explicitly remove the generated C# unit test files from the unit test project, re-add the reference to the dll under test, and start with clean "basic" unit test files added to the unit test project.
The manually-coded unit tests then would build and run without generating this error. If I let Visual Studio generate any unit tests for this project, the error returns.
This apparently has to do with problems related to "Generation of Private Accessors (Publicize) and Code Generation for Visual Studio 2010" on the Visual Studio Test Team's blog. See http://blogs.msdn.com/b/vstsqualitytools/archive/2010/01/18/publicize-and-code-generation-for-visual-studio-2010.aspx
See also the discussion at http://social.msdn.microsoft.com/Forums/en/csharplanguage/thread/0bad3473-787c-4a8d-9b11-6c345bde780c?prof=required