System.TypeLoadException : Type 'ISomething`1ProxyRandomGuid' from assembly 'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=YetAnotherGuid' is attempting to implement an inaccessible interface.
Assuming that you already added the InternalsVisibleTo from your library to your unit test project, you'll also need to add an InternalsVisibleTo to DynamicProxyGenAssembly2. However, unlike the author in the blog post, in my machine it only works if I remove the PublicKey, something like:
[assembly:InternalsVisibleTo("DynamicProxyGenAssembly2")]
No comments:
Post a Comment