I just ran into this problem; the issue seems different from the other answers posted here, so I'll mention it in case it helps someone.
In my case, I have an internal base class defined in one assembly ("A"), an internal derived class defined in a second assembly ("B"), and a test assembly ("TEST"). I exposed internals defined in assembly "B" to "TEST" using InternalsVisibleToAttribute
, but neglected to do so for assembly "A". This produced the error mentioned at top with no further indication of the problem; using InternalsVisibleToAttribute
to expose assembly "A" to "TEST" resolved the issue.