0
如何根据某些文件的内容动态更改AssemblyName?MSBuild dynamic AssemblyName
举例来说,我有一个名为“AssemblyBaseName.txt”,其中包含“ABCD”的字符串我想我的组件DLL/EXE名称是Abcd.Common.dll,其中“共同”是不变的文件。
我试着使用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>
,但没有成功。