I would like to define several friend assemblies.
It is easy to do so when editing the AssemblyInfo file manually:
[assembly:InternalsVisibleTo("Friend1a")]
[assembly:InternalsVisibleTo("Friend1b")]
or
[assembly:InternalsVisibleTo("Friend2a"),
InternalsVisibleTo("Friend2b")]
However my AssemblyInfo file is generated by an MSBuild task from the .csproj file. In this case, I can add one InternalsVisibleTo attribute, but not several.
<AssemblyInfo CodeLanguage="CS" OutputFile="$(AssemblyInfoFile)" AssemblyVersion="$(Version)" InternalsVisibleTo = "Friend1a"/>
How can I define multiple friend assemblies in my .csproj file?
Just add them in another file. 'ExtraAssemblyInfo.cs'. There is nothing special code-wise about the AssemblyInfo file it's just a long standing convention.