Hi, thanks for sharing this issue.
Is it possible that you have the
prevent signing of assembly configuration setting enabled on the project that declares the InternalsVisibleToAttribute?
If so, NCrunch will likely build the 'friend' assembly using a different strong name to that which is declared in the InternalsVisibleToAttribute. This will invalidate the attribute and produce the error you've described.
There can also be other things inside your build process that cause this problem, depending upon how heavily the build process has been customised and whether or not you're using any packages or products that manipulate the build process. This can also be caused by differences between NCrunch's build and Visual Studio's build because of
the way VS injects certain properties.
The solution to the problem is generally to adjust the InternalsVisibleToAttribute declaration so that it includes the strong name of the assembly as built by NCrunch. To prevent this from breaking your existing code built outside of NCrunch, you can specify it using a compiler condition. For example:
#if NCRUNCH
[assembly: InternalsVisibleTo("My.FriendProject, Version=1.1.0.999, Culture=neutral, PublicKeyToken=null")]
#else
[assembly: InternalsVisibleTo("My.FriendProject, PublicKey=xyz")]
#endif