Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

"Friend access was granted to" error with internals visible to
theperm
#1 Posted : Wednesday, June 4, 2014 2:17:48 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/4/2014(UTC)
Posts: 1
Location: United Kingdom

I have a project that ncrunch fails to build that has a number of projects thats its internals are visible too. It gives this error message

Some.dll (0): Friend access was granted to 'My.FriendProject, PublicKey=xyz', but the output assembly is named 'My.FriendProject, Version=1.1.0.999, Culture=neutral, PublicKeyToken=null'. Try adding a reference to 'My.FriendProject, PublicKey=xyz' or changing the output assembly name to match.

I dont understand this message and how to fix it. Added a reference to MyFriendProject would be a circualr dependancie and Some.dll already has a reference to My.FriendProject
Remco
#2 Posted : Wednesday, June 4, 2014 11:00:25 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,000

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
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
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.032 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download