Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using AssemblyInfo to automatically update multiple AssemblyInfo.cs files

I've got several AssemblyInfo.cs files as part of many projects in a single solution that I'm building automatically as part of TeamCity.

To make the msbuild script more maintainable I'd like to be able to use the AssemblyInfo community task in conjunction with an ItemGroup e.g.

<ItemGroup>
     <AllAssemblyInfos Include="..\**\AssemblyInfo.cs" />
</ItemGroup>

<AssemblyInfo AssemblyTitle="" AssemblyProduct="$(Product)" AssemblyCompany="$(Company)" AssemblyCopyright="$(Copyright)" 
                  ComVisible="false" CLSCompliant="false" CodeLanguage="CS" AssemblyDescription="$(Revision)$(BranchName)" 
                  AssemblyVersion="$(FullVersion)" AssemblyFileVersion="$(FullVersion)" OutputFile="@(AllAssemblyInfos)" />

Which blatently doesn't work because OutputFile cannot be a referenced ItemGroup.

Anyone know how to make this work?

like image 735
Kieran Benton Avatar asked Sep 22 '08 17:09

Kieran Benton


1 Answers

We use "linked" files in project. Solution Explorer -> Add Existin Item -> .. select_file .. -> arrow_on_left_of_add_button -> Add As Link

Then the selected file ( AssemblyInfo.cs for now ) is not copied to the direcotry of project, bud is only linked from specified path.

like image 118
TcKs Avatar answered Sep 21 '22 11:09

TcKs