如何根据某些文件的内容动态更改 AssemblyName?
例如,我有一个名为“AssemblyBaseName.txt”的文件,其中包含“Abcd”字符串我希望我的程序集 DLL/EXE 名称为 Abcd.Common.dll,其中“Common”是常量。
我试过像这样使用 ReadLinesFromFile
<Target Name="Build">
<ItemGroup>
<AssemblyBaseNameFile Include="Test.txt"/>
</ItemGroup>
<ReadLinesFromFile File="@(AssemblyBaseNameFile)">
<Output TaskParameter="Lines" ItemName="AssemblyBaseName" />
</ReadLinesFromFile>
<Message Text="AssemblyBaseName: $(AssemblyBaseName)" />
</Target>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{FEE469DB-44BD-4CD9-BA08-91F1DFDE9679}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Common</RootNamespace>
<AssemblyName Condition=" '$(AssemblyName)' == '' ">$(AssemblyBaseName).Common</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
但没有成功。