Apply your Strong Name Key to both DLLs to resolve Friend access was granted compiler message in C#
Posted by robkraft on July 5, 2011
You will get a compiler error message like:
“Friend access was granted to ‘your dll, PublicKey=your key’, but the output assembly is named ‘your dll, Version=…, Culture=neutral, PublicKeyToken=null’. Try adding a reference to ‘your dll…’, or changing the output assembly name to match.”
when you are using Strong Named Keys (snk) files but you only have the .SNK file assigned to one of the two projects you are trying to compile. If you are using InternalsVisibleTo to expose Friend/Internal methods to another DLL, and either one of the DLLs has a strong named key, make sure they both have a strong named key. You can use the same strong name key on both DLLs.