Behind the Brain

Adding an InternalsVisibleAttribute to an AssemblyInfo generated by MSBuild Community Tasks

When using MSBuild Community Tasks to generate assembly info for a project you may have noticed that it does not support adding the InternalsVisibleAttribute to the generated assembly info.

Since this attribute is needed for unit testing here is a simple workaround to add it:

[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("UNIT_TEST_ASSEMBLY")]

Simply add this line anywhere in a code file of your project. You may want to add an #if DEBUG or something like that around it but that is all.

Feb 26th 2012, 19:11 by Sylence.

Back to top