用于在 AssemblyInfo.cs 中设置自定义属性的 MSBuild 任务

2023-12-26

是否有用于在 AssemblyInfo.cs 中设置自定义属性的 MSBuild 任务? 我找到了 AssemblyInfo 任务,但它似乎无法设置自定义属性,只能设置预定义属性。我想设置已添加到此文件中的 3 个自定义属性。

有什么建议如何解决这个问题吗?


WriteCodeFragment http://msdn.microsoft.com/en-us/library/ff598685任务可以帮助:

<Target Name="BeforeBuild">
    <ItemGroup>
     <AssemblyAttributes Include="AssemblyTitle">
        <_Parameter1>My Assembly</_Parameter1>
     </AssemblyAttributes>
     <AssemblyAttributes Include="AssemblyDescription">
        <_Parameter1>My Assembly</_Parameter1>
     </AssemblyAttributes>  
     <AssemblyAttributes Include="AssemblyCompany">
        <_Parameter1>My Company</_Parameter1>
     </AssemblyAttributes>
     <AssemblyAttributes Include="AssemblyProduct">
        <_Parameter1>My Product</_Parameter1>
     </AssemblyAttributes>
     <AssemblyAttributes Include="AssemblyCopyright">
        <_Parameter1>Copyright © 2012</_Parameter1>
     </AssemblyAttributes>
     <AssemblyAttributes Include="AssemblyCulture">
        <_Parameter1></_Parameter1>
     </AssemblyAttributes>       
     <AssemblyAttributes Include="AssemblyVersion">
        <_Parameter1>1.0.0.0</_Parameter1>
     </AssemblyAttributes>   
     <AssemblyAttributes Include="AssemblyFileVersion">
        <_Parameter1>1.0.0.0</_Parameter1>
     </AssemblyAttributes>
     <AssemblyAttributes Include="System.Runtime.InteropServices.Guid">
        <_Parameter1>e7a979b2-0a4f-483a-ba60-124e7ef3a931</_Parameter1>
     </AssemblyAttributes>
    </ItemGroup>
  <WriteCodeFragment Language="C#" OutputFile="Properties/AssemblyInfo.cs" AssemblyAttributes="@(AssemblyAttributes)" />
</Target>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

用于在 AssemblyInfo.cs 中设置自定义属性的 MSBuild 任务 的相关文章

随机推荐