Using AssemblyInfo to automatically update multiple AssemblyInfo.cs files

前端 未结 2 1625
南笙
南笙 2020-12-30 12:13

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 scrip

相关标签:
2条回答
  • 2020-12-30 12:29

    Try changing the @ to a % as below

    <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)" />
    

    This creates a call for every entry in AllAssemblyInfos.

    Have a look at this article too, should help.

    http://blogs.msdn.com/aaronhallberg/archive/2006/09/05/msbuild-batching-generating-a-cross-product.aspx

    0 讨论(0)
  • 2020-12-30 12:48

    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.

    0 讨论(0)
提交回复
热议问题