views:

36

answers:

1

I'm using MSBuild Community Tasks to automatically update my assembly version numbers according to my Subversion repository tag. I have added the following to my project file:

This gives me a new AssemblyInfo.cs file: unfortunately I need to add the following to get my MStests to work properly:

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

But I cannot figure out how to do this - there doesn't seem to be anyway through the MSBuild Community Tasks, for example. Can anyone provide guidance on this?

+1  A: 

Simple answer: Since this is not supported by the MSBuild community task, add this to one of the files of your project.

#ifdef DEBUG
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("XLComponentsUnitTests")]
#endif

There is nothing that says the assembly attributes have to all be in one file, or all generated by the <AssemblyInfo> task.

Todd
Thanks very much Todd! Now I look back over some of the tutorials I found, they were also using your suggested approach.
Chris Spicer